mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(boltdb): remove extra allocation and copy from GetObject() EE-5622 (#9111)
This commit is contained in:
parent
716c196682
commit
b12e1aade4
1 changed files with 1 additions and 4 deletions
|
@ -28,10 +28,7 @@ func (tx *DbTransaction) GetObject(bucketName string, key []byte, object interfa
|
||||||
return fmt.Errorf("%w (bucket=%s, key=%s)", dserrors.ErrObjectNotFound, bucketName, keyToString(key))
|
return fmt.Errorf("%w (bucket=%s, key=%s)", dserrors.ErrObjectNotFound, bucketName, keyToString(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
data := make([]byte, len(value))
|
return tx.conn.UnmarshalObjectWithJsoniter(value, object)
|
||||||
copy(data, value)
|
|
||||||
|
|
||||||
return tx.conn.UnmarshalObjectWithJsoniter(data, object)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tx *DbTransaction) UpdateObject(bucketName string, key []byte, object interface{}) error {
|
func (tx *DbTransaction) UpdateObject(bucketName string, key []byte, object interface{}) error {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue