D-Programming-Language/phobos — pull request #1024 by monarchdodra (2012-12-21 19:56:29+00:00)
Title: performance tweaks for countUntil

Just two tweaks in countUntil:

The first is for ranges with length, we store the length of the haystack, so we don't have to save it.

The second is to compare the first element of the needle before calling starts with. This avoid "saving and walking" two lengths, if we *know* they don't match anyways... It also means popping the haystack less, overall.