jordanbray / chess

A rust library to manage chess move generation
https://jordanbray.github.io/chess/
MIT License
234 stars 54 forks source link

Support custom eviction policies in CacheTable #38

Closed vlad902 closed 3 years ago

vlad902 commented 3 years ago

Add CacheTable::replace_if() allowing the caller to specify a policy when to evict cache table entries. Note that unlike get(), this routine can pass default initialized entries to the caller to minimize branching.

jordanbray commented 3 years ago

This looks good to me. I can see the value here on transposition tables.