Skip to content

Commit 6eada59

Browse files
jishnubsglyon
authored andcommitted
changed UnitRange in coordlookup(r::UnitRange,x) to AbstractUnitRange, and the first element is used instead of r.start (#327)
1 parent f419b26 commit 6eada59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scaling/scaling.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ coordslookup(::Any, ::Tuple{}, ::Tuple{}) = ()
9494
coordlookup(::NoInterp, r, i) = i
9595
coordlookup(::Flag, r, x) = coordlookup(r, x)
9696

97-
coordlookup(r::UnitRange, x) = x - r.start + oneunit(eltype(r))
97+
coordlookup(r::AbstractUnitRange, x) = x - first(r) + oneunit(eltype(r))
9898
# coordlookup(i::Bool, r::AbstractRange, x) = i ? coordlookup(r, x) : convert(typeof(coordlookup(r,x)), x)
9999
coordlookup(r::StepRange, x) = (x - r.start) / r.step + oneunit(eltype(r))
100100

0 commit comments

Comments
 (0)