add some func
This commit is contained in:
parent
d598fb5ce5
commit
e592a753bf
|
@ -102,3 +102,9 @@ func DecompressBy[T, R any](a [][]T, fn func(T) (R, bool)) (r []R) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Replace[T any](a []T, offset int, replacement []T) {
|
||||||
|
aa := a[offset:]
|
||||||
|
aa = aa[:0]
|
||||||
|
aa = append(aa, replacement...)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user