elliotchance / elliotchance/orderedmap
feature request: add .Clear method
Open
- Dominant language
- Go
- Stars
- 1k
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
Currently, it's impossible to clear the `OrderedMap` keeping its capacity.
A simple implementation would be:
```go
func (l *list[K, V]) Clear() {
l.root = Element[K, V]{} // just in case K & V are pointer types
}
func (m *OrderedMap[K, V]) Clear() {
clear(m.kv)
m.ll.Clear()
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.