Skip to content

Commit

Permalink
aghalg: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Feb 14, 2024
1 parent 6b2f09a commit 37e33ec
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/aghalg/sortedmap.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package aghalg

import (
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"slices"
)

// SortedMap is a map that keeps elements in order with internal sorting
Expand Down Expand Up @@ -68,9 +67,8 @@ func (m *SortedMap[K, V]) Clear() {
return
}

// TODO(s.chzhen): Use built-in clear in Go 1.21.
m.keys = nil
maps.Clear(m.vals)
clear(m.vals)
}

// Range calls cb for each element of the map, sorted by m.cmp. If cb returns
Expand Down

0 comments on commit 37e33ec

Please sign in to comment.