1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add doc for some new methods of list

This commit is contained in:
dudaodong
2023-02-06 11:35:32 +08:00
parent c35bda6a65
commit ebe494051b
3 changed files with 499 additions and 31 deletions

View File

@@ -406,7 +406,7 @@ func (l *List[T]) Iterator() iterator.Iterator[T] {
return iterator.FromSlice(l.data)
}
// ToMap convert a list to a map based on iteratee function.
// ListToMap convert a list to a map based on iteratee function.
func ListToMap[T any, K comparable, V any](list *List[T], iteratee func(T) (K, V)) map[K]V {
result := make(map[K]V, list.Size())
for _, item := range list.data {