LPGhatguy / thunderdome

Arena type inspired by generational-arena
Apache License 2.0
197 stars 15 forks source link

Fix `insert_at` and `insert_at_slot` bug #36

Closed LPGhatguy closed 2 years ago

LPGhatguy commented 2 years ago

When inserting into a slot in the middle of the free list, the free pointer was mistakenly not updated.

This was due to Entry::get_empty() cloning data instead of returning a reference, which would've caught this bug. I've updated the method names, added a mutable version, fixed the function, and added a new test.