Specialized Base.findfirst for ranges

As far as I see at the moment julia uses the same findfirst method for all AbstractArray which simply iterates through all the items. Would it not make sense to have specialized method for ranges that would find the item’s index based on start/step/stop?


1 Like

There is a method for StepRange but not for UnitRange:


so yes, it could make sense. If someone is interested, just make a PR.

Thank you, I overlooked it. Actually StepRange is enough for me.