Skip to content

Commit

Permalink
Add CopyTo and change behavior of TransformTo (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
chen3feng authored Sep 10, 2022
1 parent 321e34a commit 9835c0d
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 96 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ There are following container interfaces:

Different interface has different methods. The `Container` interface has following methods:

- `IsEmpty() bool` Returns whether the container is empty
- `IsEmpty() bool` returns whether the container is empty
- `Len() int` returns the number of elements in the container
- `Clear()` to clear the container

Expand Down Expand Up @@ -186,6 +186,7 @@ indicating that a custom comparison function can be passed.
#### Data manipulation

- `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
- `FillPattern` repeatedly fills a slice with the specified pattern
- `Replace` replaces every element that equals to old with new
Expand Down
1 change: 1 addition & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func TestSkipList_ForEachMutable(t *testing.T) {
#### 数据操作

- `Copy` 返回切片的拷贝
- `CopyTo` 拷贝切片的内容到另一个切片
- `Fill` 用指定的值重复填充一个切片
- `FillPattern` 用指定的模式重复填充一个切片
- `Replace` 替换所有等于指定值的元素为新值
Expand Down
Loading

0 comments on commit 9835c0d

Please sign in to comment.