Will change `getTransitionIndex` to work with forward ranges.