forked from TrueCloudLab/frostfs-node
[#1671] Use slices.Delete()
where possible
gopatch is missing for this one, because https://github.com/uber-go/gopatch/issues/179 Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
155d3ddb6e
commit
460e5cbccf
7 changed files with 15 additions and 8 deletions
|
@ -288,8 +288,8 @@ func (t *Traverser) Next() []Node {
|
|||
func (t *Traverser) skipEmptyVectors() {
|
||||
for i := 0; i < len(t.vectors); i++ { // don't use range, slice changes in body
|
||||
if len(t.vectors[i]) == 0 && t.rem[i] <= 0 || t.rem[0] == 0 {
|
||||
t.vectors = append(t.vectors[:i], t.vectors[i+1:]...)
|
||||
t.rem = append(t.rem[:i], t.rem[i+1:]...)
|
||||
t.vectors = slices.Delete(t.vectors, i, i+1)
|
||||
t.rem = slices.Delete(t.rem, i, i+1)
|
||||
i--
|
||||
} else {
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue