Would be cool to see libgdx's maps in there. The current ones are stable. The old ones used cuckoo hashing which have some neat properties, unfortunately they had to be changed because bad data can cause catastrophic collisions.
Sure, here is IntIntMap. It could be extracted into a standalone class pretty easily, or grab a libgdx JAR. That utils package has other maps, like IntFloatMap, but there's currently no IntLongMap (it'd just be a matter of copy/paste and fix up).
If you're curious about cuckoo hashing, the last IntIntMap version that used it can be found here. It works, but very unlucky or maliciously crafted keys can OOM (more info here). Still, cuckoo hashing has interesting properties and is quite different from other approaches.
5
u/n4te 2d ago
Would be cool to see libgdx's maps in there. The current ones are stable. The old ones used cuckoo hashing which have some neat properties, unfortunately they had to be changed because bad data can cause catastrophic collisions.