randomairborne / expiringmap

a HashMap-backed TTL map
2 stars 1 forks source link

Add calling `vacuum` to shrink_to and shrink_to_fit #3

Closed demoray closed 4 months ago

demoray commented 4 months ago

HashMap::shrink_to_fit states "Shrinks the capacity of the map as much as possible.". Often, this is called to free up unused memory allocations. By calling vacuum here, this aligns with the intent

This also adds shrink_to and shrink_to_fit to ExpiringSet