Skip to content

feature request: add .Clear method #55

@novadev94

Description

@novadev94

Currently, it's impossible to clear the OrderedMap keeping its capacity.

A simple implementation would be:

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()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions