mirror of https://github.com/etcd-io/bbolt.git
Merge pull request #589 from nekto0n/master
Lower number of allocation in freelist.reindex()pull/24/head
commit
1561ab171f
|
@ -236,7 +236,7 @@ func (f *freelist) reload(p *page) {
|
|||
|
||||
// reindex rebuilds the free cache based on available and pending free lists.
|
||||
func (f *freelist) reindex() {
|
||||
f.cache = make(map[pgid]bool)
|
||||
f.cache = make(map[pgid]bool, len(f.ids))
|
||||
for _, id := range f.ids {
|
||||
f.cache[id] = true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue