We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5568b76 commit 7e153f8Copy full SHA for 7e153f8
kvdb/flushable/flushable.go
@@ -78,7 +78,7 @@ func (w *Flushable) Put(key []byte, value []byte) error {
78
}
79
80
func (w *Flushable) put(key []byte, value []byte) {
81
- w.modified.Put(key, common.CopyBytes(value))
+ w.modified.Put(common.CopyBytes(key), common.CopyBytes(value))
82
*w.sizeEstimation += len(key) + len(value) + 128
83
84
@@ -128,7 +128,7 @@ func (w *Flushable) Delete(key []byte) error {
128
129
130
func (w *Flushable) delete(key []byte) {
131
- w.modified.Put(key, nil)
+ w.modified.Put(common.CopyBytes(key), nil)
132
*w.sizeEstimation += len(key) + 128 // it should be (len(key) - len(old value)), but we'd need to read old value
133
134
0 commit comments