more performant fix for .[100000]

I believe this will scale better than the previous fix.
Feel free to revert if this turns out not to be the case.