Bmax Hashtables!
BlitzMax Forums/BlitzMax Programming/Bmax Hashtables!
| ||
Alright, I just added my first entry to the code archives - a hashtable type for Bmax. The code is based on the core code provided by Defoc8, although with many improvements and additions. I apologize for the ugly test/demonstration code, but I didn't have much time to tidy up the scrap code I wrote to test it. Anyhow, you can find it here: http://www.blitzmax.com/codearcs/codearcs.php?code=1907 |
| ||
Um... is there something wrong with TMap? |
| ||
It's all about using the right data structure for the job. If you need to store say, 1000 key value pairs, a hash table will be much faster than a Map. |
| ||
This hash table type also supports multiple entries per key, the ability to sort those entries on an overloaded compare method, along with some other neat features. I optimized this for speed as it was going to be the core variable type for my mudserver (mimicking the table type in Lua such that I wouldn't need to shift all of my data over to Lua or pipe everything through that darned virtual stack.) |