Skip to content

Commit

Permalink
Update ttl_shard.go
Browse files Browse the repository at this point in the history
Co-authored-by: ccoVeille <[email protected]>
  • Loading branch information
godruoyi and ccoVeille authored Nov 25, 2024
1 parent f375cd5 commit 7267a82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ttl_shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (s *ttlshard[K, V]) Set(hash uint32, key K, value V, ttl time.Duration) (pr
evictedValue := node.value

// delete the old key if the list is full, note that the list length is size+1
if uint32(len(s.list)-1) < s.tableLength+1 && key != node.key {
if len(s.list)-1 < int(s.tableLength+1) && key != node.key {
s.tableDelete(uint32(s.tableHasher(noescape(unsafe.Pointer(&node.key)), s.tableSeed)), node.key)
}

Expand Down

0 comments on commit 7267a82

Please sign in to comment.