mirror of
https://github.com/golang/go.git
synced 2024-11-21 21:11:11 +00:00
Revert f6920aaaf866d0e331b12fad4ee530079113b97f...75c3834c6757470db4b2507a742a18df4206efb6 on SliceTricks
parent
75c3834c67
commit
d970f7f1f8
@ -103,7 +103,7 @@ s[i] = x
|
||||
|
||||
#### InsertVector
|
||||
```go
|
||||
a = append(a[:i], append([]T{b}, a[i:]...)...)
|
||||
a = append(a[:i], append(b, a[i:]...)...)
|
||||
|
||||
// The above one-line way copies a[i:] twice and
|
||||
// allocates at least once.
|
||||
|
Loading…
Reference in New Issue
Block a user