Skip to content

Commit

Permalink
fix maybereverse use
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner committed Feb 22, 2022
1 parent 184c9c6 commit 0dcf200
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -816,12 +816,12 @@ function sort_int_range!(x::AbstractVector{<:Integer}, rangelen, minval, maybere
offs = 1 - minval

counts = fill(0, rangelen)
@inbounds for i = maybereverse(lo:hi)
@inbounds for i = lo:hi
counts[x[i] + offs] += 1
end

idx = lo
@inbounds for i = 1:rangelen
@inbounds for i = maybereverse(1:rangelen)
lastidx = idx + counts[i] - 1
val = i-offs
for j = idx:lastidx
Expand Down

0 comments on commit 0dcf200

Please sign in to comment.