Skip to content

Commit

Permalink
chore: using existing variables makes the program easier to understand (
Browse files Browse the repository at this point in the history
  • Loading branch information
godruoyi authored Nov 5, 2024
1 parent 9c96197 commit 9d6228e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bytes_shard_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (s *bytesshard) tableSet(hash uint32, key []byte, index uint32) (prev uint3
subhash := hash >> dibBitSize
hdib := subhash<<dibBitSize | uint32(1)&maxDIB
mask := s.tableMask
i := (hdib >> dibBitSize) & mask
i := subhash & mask
b0 := unsafe.Pointer(&s.tableBuckets[0])
l0 := unsafe.Pointer(&s.list[0])
for {
Expand Down
2 changes: 1 addition & 1 deletion lru_shard_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s *lrushard[K, V]) tableSet(hash uint32, key K, index uint32) (prev uint32
subhash := hash >> dibBitSize
hdib := subhash<<dibBitSize | uint32(1)&maxDIB
mask := s.tableMask
i := (hdib >> dibBitSize) & mask
i := subhash & mask
b0 := unsafe.Pointer(&s.tableBuckets[0])
l0 := unsafe.Pointer(&s.list[0])
for {
Expand Down
2 changes: 1 addition & 1 deletion ttl_shard_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *ttlshard[K, V]) tableSet(hash uint32, key K, index uint32) (prev uint32
subhash := hash >> dibBitSize
hdib := subhash<<dibBitSize | uint32(1)&maxDIB
mask := s.tableMask
i := (hdib >> dibBitSize) & mask
i := subhash & mask
b0 := unsafe.Pointer(&s.tableBuckets[0])
l0 := unsafe.Pointer(&s.list[0])
for {
Expand Down

0 comments on commit 9d6228e

Please sign in to comment.