Skip to content

Commit 06c8904

Browse files
committed
Apply suggestion
1 parent 3da9474 commit 06c8904

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/FindFirstFunctions.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ function (g::Guesser)(x)
239239
else
240240
i_0, i_f = firstindex(v), lastindex(v)
241241
i_approx = f * (i_f - i_0) + i_0
242-
target_type = eltype(v)
243-
if i_approx <= typemin(target_type)
244-
firstindex(v) - 1
245-
elseif i >= typemax(target_type)
242+
target_type = typeof(firstindex(v))
243+
if i_approx >= typemax(target_type)
246244
lastindex(v) + 1
245+
elseif i_approx <= typemin(target_type)
246+
firstindex(v) - 1
247247
else
248-
round(target_type, i_appr)
248+
round(target_type, i_approx)
249249
end
250250
end
251251
else

0 commit comments

Comments
 (0)