1
0
mirror of https://github.com/taigrr/bitcask synced 2025-01-18 04:03:17 -08:00

Fix a bug wit the decoder passing the wrong value for the value's offset into the buffer (#77)

This commit is contained in:
James Mills
2019-08-31 08:35:17 +10:00
committed by GitHub
parent ea96b8afc0
commit 36bc134b22

View File

@@ -80,7 +80,7 @@ func (d *Decoder) Decode(v *Entry) (int64, error) {
return 0, errors.Wrap(translateError(err), "failed reading saved data") return 0, errors.Wrap(translateError(err), "failed reading saved data")
} }
DecodeWithoutPrefix(buf, actualValueSize, v) DecodeWithoutPrefix(buf, actualKeySize, v)
return int64(KeySize + ValueSize + actualKeySize + actualValueSize + checksumSize), nil return int64(KeySize + ValueSize + actualKeySize + actualValueSize + checksumSize), nil
} }