[#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:
Evgenii Stratonikov 2025-03-13 09:24:44 +03:00 committed by Evgenii Stratonikov
parent 155d3ddb6e
commit 460e5cbccf
7 changed files with 15 additions and 8 deletions

View file

@ -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