From 64cf7392907345f2a1ae37b7cc5289058f1e1e25 Mon Sep 17 00:00:00 2001 From: Ben Arthur Date: Wed, 25 Oct 2023 14:46:22 -0400 Subject: [PATCH] used binary search on string indices --- src/LookupArrays/selector.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LookupArrays/selector.jl b/src/LookupArrays/selector.jl index 4b60c8ee1..c7ee0e3d2 100644 --- a/src/LookupArrays/selector.jl +++ b/src/LookupArrays/selector.jl @@ -138,7 +138,7 @@ function at( end end function at( - ::Ordered, ::Span, lookup::LookupArray{<:Union{Number,Dates.TimeType}}, selval, atol, rtol::Nothing; + ::Ordered, ::Span, lookup::LookupArray{<:Union{Number,Dates.TimeType,AbstractString}}, selval, atol, rtol::Nothing; err=_True() ) x = unwrap(selval) @@ -163,7 +163,7 @@ function at( end end end -# catch-all for an unordered or non-number index +# catch-all for an unordered index function at(::Order, ::Span, lookup::LookupArray, selval, atol, rtol::Nothing; err=_True()) i = findfirst(x -> _is_at(x, unwrap(selval), atol), parent(lookup)) if i === nothing