db: sort keys for memdb iterator

This commit is contained in:
Ethan Buchman 2017-11-20 03:06:18 +00:00
parent 2442a0a698
commit 135a1a7cd7
1 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package db
import (
"fmt"
"sort"
"strings"
"sync"
)
@ -127,6 +128,8 @@ func (db *MemDB) IteratorPrefix(prefix []byte) Iterator {
it.keys = append(it.keys, key)
}
}
// and we need to sort them
sort.Strings(it.keys)
return it
}