add comment // bounds check

This commit is contained in:
go101 2023-11-16 23:28:19 +08:00
parent d50cae90e1
commit 1bbec230f4
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ func ContainsFunc[S ~[]E, E any](s S, f func(E) bool) bool {
// Insert panics if i is out of range.
// This function is O(len(s) + len(v)).
func Insert[S ~[]E, E any](s S, i int, v ...E) S {
_ = s[i:]
_ = s[i:] // bounds check
m := len(v)
if m == 0 {