netmap: Add method Clone
#344
No reviewers
TrueCloudLab/storage-services-committers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#344
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-sdk-go:feature/add-clone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
Clone
00bbc56b6d
to224e921447
@ -468,0 +485,4 @@
state: ni.state,
}
for _, v := range ni.attributes {
dst.attributes = append(dst.attributes, *v.Clone())
dst.attributes
can be preallocated, we know its size exactly.Fixed.
@ -99,0 +102,4 @@
epoch: x.epoch,
}
for _, node := range x.nodes {
dst.nodes = append(dst.nodes, *node.Clone())
dst.nodes
can be preallocated.Fixed.
@ -48,0 +54,4 @@
c := nm.Clone()
require.True(t, c != nm)
I would also check that they serialize to exactly the same value (byte-by-byte).
Added.
224e921447
to6b84730319
6b84730319
to0085de210c
WIP: netmap: Add methodto netmap: Add methodClone
Clone
@ -382,6 +385,15 @@ func (a *Attribute) SetParents(parent []string) {
a.parents = parent
}
// Clone returns a copy of Attribute.
As this is SDK, I think it is required to add a
nil
check.Fair point, check added.
0085de210c
to749b4e9ab5