[#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
29b0240673
commit
803a550c1f
7 changed files with 15 additions and 8 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
"strconv"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
|
@ -182,7 +183,7 @@ func (exec *execCtx) addMembers(incoming []oid.ID) {
|
|||
for i := range members {
|
||||
for j := 0; j < len(incoming); j++ { // don't use range, slice mutates in body
|
||||
if members[i].Equals(incoming[j]) {
|
||||
incoming = append(incoming[:j], incoming[j+1:]...)
|
||||
incoming = slices.Delete(incoming, j, j+1)
|
||||
j--
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue