fix: cleanup

This commit is contained in:
Tristan Cartledge
2023-12-01 17:47:55 +00:00
parent a4ad09aab3
commit 1a384fd982
9 changed files with 14 additions and 23 deletions

View File

@@ -140,7 +140,7 @@ func Iterate[K comparable, V any](ctx context.Context, m *Map[K, V]) <-chan Pair
}
go func() {
defer close(c)
for pair := m.First(); pair != nil; pair = pair.Next() {
for pair := First(m); pair != nil; pair = pair.Next() {
select {
case c <- pair:
case <-ctx.Done():
@@ -196,7 +196,7 @@ func SortAlpha[K comparable, V any](m *Map[K, V]) *Map[K, V] {
}
keys := []key{}
for pair := m.First(); pair != nil; pair = pair.Next() {
for pair := First(m); pair != nil; pair = pair.Next() {
keys = append(keys, key{
key: fmt.Sprintf("%v", pair.Key()),
k: pair.Key(),