diff --git a/README.md b/README.md index e1d7afb..b001ddc 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,7 @@ indicating that a custom comparison function can be passed. - `Copy` return a copies of specified slice - `CopyTo` copies all elements in slice a to slice to, return the copied slice. - `Fill` repeatedly fills a slice with the specified value +- `FillZero` fills each element in slice a with zero value. - `FillPattern` repeatedly fills a slice with the specified pattern - `Replace` replaces every element that equals to old with new - `ReplaceIf` replaces every element that make preq returns true with new diff --git a/README_zh.md b/README_zh.md index 37166a2..4f2e817 100644 --- a/README_zh.md +++ b/README_zh.md @@ -177,6 +177,7 @@ func TestSkipList_ForEachMutable(t *testing.T) { - `Copy` 返回切片的拷贝 - `CopyTo` 拷贝切片的内容到另一个切片 - `Fill` 用指定的值重复填充一个切片 +- `FillZero` 用类型的零值重复填充一个切片 - `FillPattern` 用指定的模式重复填充一个切片 - `Replace` 替换所有等于指定值的元素为新值 - `ReplaceIf` 替换所有让函数返回 `true` 的元素为新值 diff --git a/transform.go b/transform.go index ce5369f..3dbc92e 100644 --- a/transform.go +++ b/transform.go @@ -36,7 +36,7 @@ func Fill[T any](a []T, v T) { } } -// Fill fills each element in slice a with zero value. +// FillZero fills each element in slice a with zero value. // // Complexity: O(len(a)). func FillZero[T any](a []T) {