mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-07-12 15:19:19 +00:00
Merge pull request #589 from nekto0n/master
Lower number of allocation in freelist.reindex()
This commit is contained in:
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…
x
Reference in New Issue
Block a user