From 02078785075ddeaeaceeb6bf90bd35385476dfb2 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Sun, 21 Nov 2021 23:09:40 +0800 Subject: [PATCH] fix(setx): fix make cap --- storage/dao/setx.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/dao/setx.go b/storage/dao/setx.go index 9247b95..6b27511 100644 --- a/storage/dao/setx.go +++ b/storage/dao/setx.go @@ -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 {