fix(setx): fix make cap

This commit is contained in:
bandl 2021-11-21 23:09:40 +08:00
parent 813b48b650
commit 0207878507
1 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,7 @@ func (d *Dao) SAdd(key *proto.BaseKey, setVal []string) (*proto.SAddResponse, er
hashVal.SetX(sv, sv)
}
d.lru.Add(key, hashVal)
return &proto.SAddResponse{}, nil
}
hashVal, ok := value.(structure.HashXInterface)
@ -60,7 +61,7 @@ func mathSDiff(masterItem []string, extKey []string) ([]string, error) {
m[bVal] = struct{}{}
}
setItem := make([]string, 0, len(extKey))
setItem := make([]string, 0, len(masterItem))
ctx := context.Background()
for _, sKey := range extKey {
baseKey := proto.NewBaseKey(sKey)
@ -160,7 +161,7 @@ func mathSInter(masterItem []string, extKey []string) ([]string, error) {
m[bVal] = struct{}{}
}
setItem := make([]string, 0, len(extKey))
setItem := make([]string, 0, len(masterItem))
ctx := context.Background()
for _, sKey := range extKey {