mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 08:46:56 +08:00
Modify the implementation of database RWLocks and RWUnLocks
This commit is contained in:
@@ -71,10 +71,10 @@ func (locks *Locks) RUnLock(key string) {
|
||||
}
|
||||
|
||||
func (locks *Locks) toLockIndices(keys []string, reverse bool) []uint32 {
|
||||
indexMap := make(map[uint32]bool)
|
||||
indexMap := make(map[uint32]struct{})
|
||||
for _, key := range keys {
|
||||
index := locks.spread(fnv32(key))
|
||||
indexMap[index] = true
|
||||
indexMap[index] = struct{}{}
|
||||
}
|
||||
indices := make([]uint32, 0, len(indexMap))
|
||||
for index := range indexMap {
|
||||
|
Reference in New Issue
Block a user