Optimize needs to use the new container logic

When calling `.optimize`, need to grab the new container which
may be different from the original container.
This commit is contained in:
Seebs 2019-06-04 08:55:35 -05:00
parent 973579e662
commit 372c369e7c

View file

@ -971,11 +971,9 @@ func (b *Bitmap) countEmptyContainers() int {
// Optimize converts array and bitmap containers to run containers as necessary.
func (b *Bitmap) Optimize() {
citer, _ := b.Containers.Iterator(0)
for citer.Next() {
_, c := citer.Value()
c.optimize()
}
b.Containers.UpdateEvery(func(c *Container, existed bool) (*Container, bool) {
return c.optimize(), true
})
}
type errWriter struct {
@ -3519,7 +3517,7 @@ RUNLOOP:
}
}
output := NewContainerRun(runs)
output.optimize()
output = output.optimize()
return output
}