mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
ethdb/pebble: using slices.Clone
This commit is contained in:
parent
7481398a24
commit
9441850812
1 changed files with 3 additions and 4 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"slices"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
|
@ -299,8 +300,7 @@ func (d *Database) Get(key []byte) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := make([]byte, len(dat))
|
||||
copy(ret, dat)
|
||||
ret := slices.Clone(dat)
|
||||
closer.Close()
|
||||
return ret, nil
|
||||
}
|
||||
|
|
@ -379,8 +379,7 @@ func (snap *snapshot) Get(key []byte) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := make([]byte, len(dat))
|
||||
copy(ret, dat)
|
||||
ret := slices.Clone(dat)
|
||||
closer.Close()
|
||||
return ret, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue