mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
Revert f6920aaaf866d0e331b12fad4ee530079113b97f...75c3834c6757470db4b2507a742a18df4206efb6 on SliceTricks
parent
75c3834c67
commit
d970f7f1f8
@ -103,7 +103,7 @@ s[i] = x
|
|||||||
|
|
||||||
#### InsertVector
|
#### InsertVector
|
||||||
```go
|
```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
|
// The above one-line way copies a[i:] twice and
|
||||||
// allocates at least once.
|
// allocates at least once.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user