[#96] node: Drop neo-go's slices package

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-11-17 10:58:04 +03:00
parent 47286ebf32
commit 76ff26039c
9 changed files with 25 additions and 20 deletions

View file

@ -17,7 +17,6 @@ import (
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
"github.com/mr-tron/base58"
"github.com/nspcc-dev/neo-go/pkg/util/slice"
"go.etcd.io/bbolt"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
@ -106,12 +105,12 @@ func (c *cache) flushSmallObjects(ctx context.Context) {
if len(lastKey) == len(k) {
copy(lastKey, k)
} else {
lastKey = slice.Copy(k)
lastKey = bytes.Clone(k)
}
m = append(m, objectInfo{
addr: string(k),
data: slice.Copy(v),
data: bytes.Clone(v),
})
}
return nil

View file

@ -1,6 +1,7 @@
package writecachebbolt
import (
"bytes"
"context"
"time"
@ -12,7 +13,6 @@ import (
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
"github.com/nspcc-dev/neo-go/pkg/util/slice"
"go.etcd.io/bbolt"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
@ -95,7 +95,7 @@ func Get(db *bbolt.DB, key []byte) ([]byte, error) {
if value == nil {
return logicerr.Wrap(new(apistatus.ObjectNotFound))
}
value = slice.Copy(value)
value = bytes.Clone(value)
return nil
})
return value, metaerr.Wrap(err)