Add a fast path for file extensions so we don't walk the list of
allocations for workloads where we already know we want to either
extend, or add an element after, the last element.  Ref #924.
*shrug*  Don't put an if/else inside the for loop, it's not needed and
it may help the compiler figure out the code motion.

Assert we never append an entry that's in the wrong place.
whitespace