Skip to content

Commit 8645c5f

Browse files
committed
fix
1 parent f63cd25 commit 8645c5f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/slices/slices.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,7 @@ func Concat[S ~[]E, E any](dst S, slices ...S) S {
502502
}
503503
dst = Grow(dst, len(dst)+sl)
504504
for _, s := range slices {
505-
if sLen := len(s); sLen != 0 {
506-
dst = append(dst, s...)
507-
}
505+
dst = append(dst, s...)
508506
}
509507
return dst
510508
}

src/slices/slices_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ func TestConcat(t *testing.T) {
10691069

10701070
s3 := []bool{false, true}
10711071
s4 := Concat(s3, nil, []bool{true})
1072-
if want := []bool{false, true, true}; !Equal(s2, want) {
1073-
t.Errorf("want %v, got %v", want, s2)
1072+
if want := []bool{false, true, true}; !Equal(s4, want) {
1073+
t.Errorf("want %v, got %v", want, s4)
10741074
}
10751075
}

0 commit comments

Comments
 (0)