Skip to content

0.2.7 "Tiny Trim"

Compare
Choose a tag to compare
@tommyettinger tommyettinger released this 11 Feb 07:57
· 832 commits to master since this release

This release fixes the shrink() method in maps and sets when the shrink would have reduced the table's capacity to less than what it needed to hold its current items. Because some usage may want to indiscriminately (or by iteration order, from the end, for ordered maps and sets) remove items until a specific size has been reached, there is now a truncate() method on all maps and sets. There was already a very similar truncate() on lists.

There are some fixes and additions to the random number generator code. To help ease conversion between the similar codebases of ShaiRandom and jdkgdxds, MizuchiRandom was added here. Mizuchi is similar to LaserRandom in that it has two states, but has less correlation between initial seeds and the resulting sequence; it is, however, slightly slower than LaserRandom usually, and does not allow skip(long). TrimRandom changed slightly in what constants it uses and has become much more robust as a result; it is now considered stable. FourWheelRandom.previousLong() was badly broken before and is now fixed.

If you're looking in the tests, there is an actually-working map that uses Cuckoo Hashing with a Stash (ObjectObjectCuckooMap), and it can take 500,000 keys with identical hashes but different equality (albeit slowly). This was something that everyone tried to find and no one fully solved before I decided to bite the bullet and reimplement all of libGDX's hash-based data structures. Now it is solved, but because insertion into a cuckoo-hashed map is just generally several times slower than the style jdkgdxds uses, without any operations being drastically faster, it's best that jdkgdxds sticks with what it has already.