Skip to content

Commit 8b5cdac

Browse files
committed
Fix findfirst deprecation
1 parent cf9e967 commit 8b5cdac

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
julia 0.5
2-
Compat 0.30
2+
Compat 0.33

src/FixedPointDecimals.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ function parse{T, f}(::Type{FD{T, f}}, str::AbstractString, mode::RoundingMode=R
380380
end
381381

382382
# Parse exponent information
383-
exp_index = findfirst(str, 'e')
383+
exp_index = findfirst(equalto('e'), str)
384384
if exp_index > 0
385385
exp = parse(Int, str[(exp_index + 1):end])
386386
sig_end = exp_index - 1
@@ -391,7 +391,7 @@ function parse{T, f}(::Type{FD{T, f}}, str::AbstractString, mode::RoundingMode=R
391391

392392
# Remove the decimal place from the string
393393
sign = T(first(str) == '-' ? -1 : 1)
394-
dec_index = findfirst(str, '.')
394+
dec_index = findfirst(equalto('.'), str)
395395
sig_start = sign < 0 ? 2 : 1
396396
if dec_index > 0
397397
int_str = str[sig_start:(dec_index - 1)] * str[(dec_index + 1):sig_end]

test/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function integer_alt{T<:Integer}(::Type{T}, dp::Integer, val::AbstractFloat)
1919
# perform any rounding.
2020
str = float_string(val)
2121
sign = T(first(str) == '-' ? -1 : 1)
22-
decimal = findfirst(str, '.')
22+
decimal = findfirst(equalto('.'), str)
2323
int_start = sign < 0 ? 2 : 1
2424
int_end = decimal + dp
2525
v = parse(T, str[int_start:(decimal - 1)] * str[(decimal + 1):int_end])

0 commit comments

Comments
 (0)