diff --git a/pkg/core/storage/memory_store.go b/pkg/core/storage/memory_store.go index 21ded2220..5fe843b19 100644 --- a/pkg/core/storage/memory_store.go +++ b/pkg/core/storage/memory_store.go @@ -23,12 +23,12 @@ type MemoryBatch struct { // Put implements the Batch interface. func (b *MemoryBatch) Put(k, v []byte) { - _ = b.MemoryStore.Put(k, v) + b.MemoryStore.put(string(k), slice.Copy(v)) } // Delete implements Batch interface. func (b *MemoryBatch) Delete(k []byte) { - _ = b.MemoryStore.Delete(k) + b.MemoryStore.drop(string(k)) } // NewMemoryStore creates a new MemoryStore object. diff --git a/pkg/core/storage/store.go b/pkg/core/storage/store.go index 540fdcc39..a90466a02 100644 --- a/pkg/core/storage/store.go +++ b/pkg/core/storage/store.go @@ -52,7 +52,8 @@ type ( // Batch represents an abstraction on top of batch operations. // Each Store implementation is responsible of casting a Batch - // to its appropriate type. + // to its appropriate type. Batches can only be used in a single + // thread. Batch interface { Delete(k []byte) Put(k, v []byte)