f8ab6e9247
While we're at it, we can also improve some of the allocations and copying that would be going on in one case by preallocating and then emplacing before modifying.