~emersion/drmdb

f7e285953c78ce18e62043beaa460209235fe79e — Simon Ser 2 years ago b0fd53f
Sort keys in walkLatest
1 files changed, 8 insertions(+), 1 deletions(-)

M server.go
M server.go => server.go +8 -1
@@ 133,7 133,14 @@ func walkLatest(f walkLatestField, fn func(k string, n *drmtree.Node) error) err
		return err
	}

	for _, n := range latest {
	keys := make([]string, 0, len(latest))
	for k := range latest {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	for _, k := range keys {
		n := latest[k]
		if err := fn(n.k, n.n); err != nil {
			return err
		}