Abuse of the TMap?
BlitzMax Forums/BlitzMax Programming/Abuse of the TMap?
| ||
Hey, I recently discovered the use of the "Compare" Method, and had a brief view into the TMap code. I always noticed, that Objects in the Map are "sorted" in some obfuscating way. Until recently, when I, just for testing, overrided the "compare" Method with custom one of mine, and tadaaa! Suddenly I could use the TMap not only to .. map stuff, but even to sort it! And since I just need a good sorting technique, where the sorting should ideally take place alongside with the inserting, I'd like to know, how much of a big deal would that "map sorting" be (regarding speed, mem etc)? Here is my test: |
| ||
Abuse of the TMap? Impossible. |
| ||
I always noted, that Objects in the Map are "sorted" in some obfuscating way Not really obfuscating. TMap uses a Red-black Tree IIRC: http://en.wikipedia.org/wiki/Red-black_tree |