i forgor to commit sorry

This commit is contained in:
2026-04-06 11:04:53 +01:00
parent 60d6a287e5
commit ce83000e0c
12 changed files with 327 additions and 55 deletions
+26
View File
@@ -0,0 +1,26 @@
// Generic helpers
package main
import (
"sync"
"sort"
)
func rangeOrdered(m *sync.Map, fn func(k, v any) bool) {
var keys []string
m.Range(func(k, v any) bool {
keys = append(keys, k.(string))
return true
})
sort.Strings(keys)
for _, k := range keys {
v, _ := m.Load(k)
if !fn(k, v) {
break
}
}
}