Skip to content

Commit 2465073

Browse files
committed
Merge remote-tracking branch 'LSchwerdt/pagedmergesort' into pagedmergesort
2 parents 7841b6a + 90c0ca6 commit 2465073

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SortingAlgorithms.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ end
685685
###
686686

687687
# merge v[lo:hiA] and v[hiA+1:hi] ([A;B]) using buffer t[1:1 + hi-lo]
688+
# this is faster than merge! but requires twice as much auxiliary memory.
688689
function twoended_merge!(v::AbstractVector{T}, t::AbstractVector{T}, lo::Integer, hiA::Integer, hi::Integer, o::Ordering) where T
689690
@assert lo <= hiA <= hi
690691
loA = lo
@@ -748,7 +749,7 @@ function twoended_merge!(v::AbstractVector{T}, t::AbstractVector{T}, lo::Integer
748749
# copy back from t to v
749750
offset = lo-1
750751
len = 1 + hi - lo
751-
@inbounds for i = 1:len
752+
for i = 1:len
752753
v[offset+i] = t[i]
753754
end
754755
end

0 commit comments

Comments
 (0)