I can't see the previous rewrite, but this rewrite look good, but it iterates completely differently. It now iterates over prev, current, next, all forward, but the old code iteratred over current first, then in reverse over next and prev (interleaved in that order).

Does the ordering matter at all? I'm guessing since it went from find to find_all that ordering is not a concern anymore.