Skip to content

Commit

Permalink
feat(eval): made changes according to the latest rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
superiorsd10 committed Jan 11, 2025
1 parent 1423080 commit 9edd2a5
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
Expand Up @@ -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,
Expand All @@ -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{
Expand Down

0 comments on commit 9edd2a5

Please sign in to comment.