fastcache
fastcache copied to clipboard
why fastcache not do hashcode collision?
in file fastcache.go, func (b *bucket) Set, line 359:
b.m[h] = idx | (b.gen << bucketSizeBits)
I think the code should be:
if oldValue, ok := b.m[h]; ok{
//do something, or the last key of same hashcode will lost
}
thanks.
sorry, I don't see all logic. If there is a check, clean() will not remove expires data. But we can still add a hashcode collision check, and tell calller the over write old value.