mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
ethdb/memory: copy byte range
This commit is contained in:
parent
ad34d98cf1
commit
ce07496f18
1 changed files with 3 additions and 2 deletions
|
|
@ -18,6 +18,7 @@
|
|||
package memorydb
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
|
|
@ -259,8 +260,8 @@ func (b *batch) Delete(key []byte) error {
|
|||
// DeleteRange removes all keys in the range [start, end) from the batch for later committing.
|
||||
func (b *batch) DeleteRange(start, end []byte) error {
|
||||
b.writes = append(b.writes, keyvalue{
|
||||
rangeFrom: start,
|
||||
rangeTo: end,
|
||||
rangeFrom: bytes.Clone(start),
|
||||
rangeTo: bytes.Clone(end),
|
||||
delete: true,
|
||||
})
|
||||
b.size += len(start) + len(end)
|
||||
|
|
|
|||
Loading…
Reference in a new issue