mirror of
https://github.com/golang/go
synced 2024-09-28 20:14:28 -06:00
re
This commit is contained in:
parent
2860f411c3
commit
48bb3bb05c
@ -127,7 +127,7 @@ func ContainsFunc[S ~[]E, E any](s S, f func(E) bool) bool {
|
|||||||
// The elements at s[i:] are shifted up to make room.
|
// The elements at s[i:] are shifted up to make room.
|
||||||
// In the returned slice r, r[i] == v[0],
|
// In the returned slice r, r[i] == v[0],
|
||||||
// and r[i+len(v)] == value originally at r[i].
|
// and r[i+len(v)] == value originally at r[i].
|
||||||
// Insert panics if i is out of range, which means i > len(s).
|
// Insert panics if i is out of range.
|
||||||
// This function is O(len(s) + len(v)).
|
// This function is O(len(s) + len(v)).
|
||||||
func Insert[S ~[]E, E any](s S, i int, v ...E) S {
|
func Insert[S ~[]E, E any](s S, i int, v ...E) S {
|
||||||
n := len(s)
|
n := len(s)
|
||||||
|
Loading…
Reference in New Issue
Block a user