mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
Updated SliceTricks (markdown)
parent
10042f7dbc
commit
ebf9e50491
@ -19,8 +19,8 @@ b = append([]T(nil), a...)
|
|||||||
b = append(a[:0:0], a...)
|
b = append(a[:0:0], a...)
|
||||||
|
|
||||||
// This one-line implementation is equivalent to the above
|
// This one-line implementation is equivalent to the above
|
||||||
// tow-line make+copy implementation. But it is actually
|
// tw0-line make+copy implementation logically. But it is
|
||||||
// a bit slower (as of Go toolchain v1.16).
|
// actually a bit slower (as of Go toolchain v1.16).
|
||||||
b = append(make([]T, 0, len(a)), a...)
|
b = append(make([]T, 0, len(a)), a...)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user