Skip to content

Commit

Permalink
fix wrong state of WriteSetObject
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejianjun committed Aug 26, 2024
1 parent 893a6cf commit a878ba8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ func (enc *Encoder) WriteSetObject(key string, values [][]byte, options ...inter
if err != nil {
return err
}
if ok {
return nil
}
err = enc.writeSetEncoding(key, values)
if err != nil {
return err
if !ok {
err = enc.writeSetEncoding(key, values)
if err != nil {
return err
}
}
enc.state = writtenObjectState
return nil
Expand Down

0 comments on commit a878ba8

Please sign in to comment.