Skip to content

Commit

Permalink
Object Type changed and casted during RDB serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitbbhayani committed Dec 4, 2024
1 parent fbbfea2 commit fdbb979
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/eval/dump_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ func rdbDeserialize(data []byte) (*object.Obj, error) {
if err != nil {
return nil, err
}
objType, err := buf.ReadByte()
_oType, err := buf.ReadByte()
if err != nil {
return nil, err
}

objType := object.ObjectType(_oType)
switch objType {
case object.ObjTypeString:
value, err = readString(buf)
Expand Down Expand Up @@ -112,7 +114,7 @@ func readSet(buf *bytes.Reader) (interface{}, error) {
func rdbSerialize(obj *object.Obj) ([]byte, error) {
var buf bytes.Buffer
buf.WriteByte(0x09)
buf.WriteByte(obj.Type)
buf.WriteByte(byte(obj.Type))
switch obj.Type {
case object.ObjTypeString:
str, ok := obj.Value.(string)
Expand Down

0 comments on commit fdbb979

Please sign in to comment.