Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (tr *Map[K, V]) init(degree int) {
}

// Set or replace a value for a key
// returns (prior value at key, did prior value exist)
func (tr *Map[K, V]) Set(key K, value V) (V, bool) {
item := mapPair[K, V]{key: key, value: value}
if tr.root == nil {
Expand Down Expand Up @@ -265,6 +266,7 @@ func (n *mapNode[K, V]) scan(iter func(key K, value V) bool) bool {
}

// Get a value for key
// Returns value, found
func (tr *Map[K, V]) Get(key K) (V, bool) {
if tr.root == nil {
return tr.empty.value, false
Expand Down