Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eval): made changes according to the latest rebase
Browse files Browse the repository at this point in the history
superiorsd10 committed Dec 24, 2024
1 parent cc9989e commit ced5fea
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions internal/eval/store_eval.go
Original file line number Diff line number Diff line change
@@ -4772,15 +4772,8 @@ func evalSADD(args []string, store *dstore.Store) *EvalResponse {
// If the object does not exist, create a new set
set = make(map[string]struct{}, lengthOfItems)
} else {
// Type and encoding checks
if err := object.AssertType(obj.TypeEncoding, object.ObjTypeSet); err != nil {
return &EvalResponse{
Result: nil,
Error: diceerrors.ErrWrongTypeOperation,
}
}

if err := object.AssertEncoding(obj.TypeEncoding, object.ObjEncodingSetStr); err != nil {
// Type checks
if err := object.AssertType(obj.Type, object.ObjTypeSet); err != nil {
return &EvalResponse{
Result: nil,
Error: diceerrors.ErrWrongTypeOperation,
@@ -4799,7 +4792,7 @@ func evalSADD(args []string, store *dstore.Store) *EvalResponse {
}

// Single Put operation at the end
obj = store.NewObj(set, -1, object.ObjTypeSet, object.ObjEncodingSetStr)
obj = store.NewObj(set, -1, object.ObjTypeSet)
store.Put(key, obj, dstore.WithKeepTTL(false), dstore.WithPutCmd(dstore.SADD))

return &EvalResponse{

0 comments on commit ced5fea

Please sign in to comment.