JuliaLang/julia — pull request #6776 by wsliang (2014-05-07 19:37:09+00:00)
Title: Fix searchsorted for Ranges

When a is a Range instead of a Vector, searchsorted(a, x, o::Ordering) is computed in constant time, instead of logarithmic time. However, this optimization only works when o is a DirectOrdering, and this restriction was not being enforced.