From 98b81a0c9cc243e159238322320bad3dc7e863eb Mon Sep 17 00:00:00 2001 From: Jyotinder Date: Sat, 14 Dec 2024 22:05:23 +0530 Subject: [PATCH] cleanup --- internal/eval/store_eval.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/eval/store_eval.go b/internal/eval/store_eval.go index f9a3e26ec..c27597eab 100644 --- a/internal/eval/store_eval.go +++ b/internal/eval/store_eval.go @@ -203,6 +203,10 @@ func evalSET(args []string, store *dstore.Store) *EvalResponse { key, value = args[0], args[1] storedValue, oType := getRawStringOrInt(value) + if oType != object.ObjTypeInt && oType != object.ObjTypeString { + return makeEvalError(diceerrors.ErrUnsupportedEncoding(int(oType))) + } + for i := 2; i < len(args); i++ { arg := strings.ToUpper(args[i]) switch arg { @@ -294,10 +298,6 @@ func evalSET(args []string, store *dstore.Store) *EvalResponse { } } - if oType != object.ObjTypeInt && oType != object.ObjTypeString { - return makeEvalError(diceerrors.ErrUnsupportedEncoding(int(oType))) - } - // putting the k and value in a Hash Table store.Put(key, store.NewObj(storedValue, exDurationMs, oType), dstore.WithKeepTTL(keepttl)) if oldVal != nil {