forked from TrueCloudLab/frostfs-node
7ccd1625af
Remove `Object` and `RawObject` types from `pkg/core/object` package. Use `Object` type from NeoFS SDK Go library everywhere. Avoid using the deprecated elements. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
21 lines
443 B
Go
21 lines
443 B
Go
package util
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-sdk-go/object"
|
|
)
|
|
|
|
// MergeSplitInfo ignores conflicts and rewrites `to` with non empty values
|
|
// from `from`.
|
|
func MergeSplitInfo(from, to *object.SplitInfo) *object.SplitInfo {
|
|
to.SetSplitID(from.SplitID()) // overwrite SplitID and ignore conflicts
|
|
|
|
if lp := from.LastPart(); lp != nil {
|
|
to.SetLastPart(lp)
|
|
}
|
|
|
|
if link := from.Link(); link != nil {
|
|
to.SetLink(link)
|
|
}
|
|
|
|
return to
|
|
}
|