diff --git a/src/slices/slices.go b/src/slices/slices.go index 252a8eecfc..465af14f8e 100644 --- a/src/slices/slices.go +++ b/src/slices/slices.go @@ -268,9 +268,7 @@ func Replace[S ~[]E, E any](s S, i, j int, v ...E) S { if i+len(v) <= j { // Easy, as v fits in the deleted portion. copy(r[i:], v) - if i+len(v) != j { - copy(r[i+len(v):], s[j:]) - } + copy(r[i+len(v):], s[j:]) return r }