Oh, my bad. I misread `neededCapacity * growthFactor` as `length * growthFactor` because the documentation says that

> [t]he new capacity is the product of **the current capacity** and the given [[growthFactor]].

(emphasis mine), which isn’t what this code does… right?