Skip to content

Commit

Permalink
Change one(T) => T(1)
Browse files Browse the repository at this point in the history
* This file is compiled early during bootstrap, and `one` is not yet
  available
  • Loading branch information
kmsquire committed Apr 8, 2019
1 parent 77ef746 commit 93c5ac4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ partialsort(v::AbstractVector, k::Union{Int,OrdinalRange}; kws...) =
# index of the first value of vector a that is greater than or equal to x;
# returns length(v)+1 if x is greater than all values in v.
function searchsortedfirst(v::AbstractVector, x, lo::T, hi::T, o::Ordering) where T<:Integer
u = one(T)
u = T(1)
lo = lo - u
hi = hi + u
@inbounds while lo < hi - u
Expand All @@ -188,7 +188,7 @@ end
# index of the last value of vector a that is less than or equal to x;
# returns 0 if x is less than all values of v.
function searchsortedlast(v::AbstractVector, x, lo::T, hi::T, o::Ordering) where T<:Integer
u = one(T)
u = T(1)
lo = lo - u
hi = hi + u
@inbounds while lo < hi - u
Expand All @@ -206,7 +206,7 @@ end
# if v does not contain x, returns a 0-length range
# indicating the insertion point of x
function searchsorted(v::AbstractVector, x, ilo::T, ihi::T, o::Ordering) where T<:Integer
u = one(T)
u = T(1)
lo = ilo - u
hi = ihi + u
@inbounds while lo < hi - u
Expand Down

0 comments on commit 93c5ac4

Please sign in to comment.