@@ -710,6 +710,7 @@ function unguarded_insertion_sort!(v::AbstractVector, lo::Integer, hi::Integer,
710
710
end
711
711
v[j] = x
712
712
end
713
+ v
713
714
end
714
715
715
716
"""
@@ -952,7 +953,6 @@ function partition_right!(v::AbstractVector, lo::Integer, hi::Integer, a::Branch
952
953
953
954
end
954
955
return pivot_position, was_already_partitioned
955
-
956
956
end
957
957
958
958
"""
@@ -1007,7 +1007,6 @@ function partition_left!(v::AbstractVector, lo::Integer, hi::Integer, o::Orderin
1007
1007
v[pivot_position] = pivot
1008
1008
end
1009
1009
return pivot_position
1010
-
1011
1010
end
1012
1011
1013
1012
# midpoint was added to Base.sort in version 1.4 and later moved to Base
@@ -1071,7 +1070,7 @@ function pdqsort_loop!(v::AbstractVector, lo::Integer, hi::Integer, a::PatternDe
1071
1070
else
1072
1071
unguarded_insertion_sort! (v, lo, hi, o)
1073
1072
end
1074
- return
1073
+ return v
1075
1074
end
1076
1075
1077
1076
# Choose pivot as median of 3 or pseudomedian of 9.
@@ -1104,7 +1103,7 @@ function pdqsort_loop!(v::AbstractVector, lo::Integer, hi::Integer, a::PatternDe
1104
1103
bad_allowed -= 1
1105
1104
if bad_allowed == 0
1106
1105
sort! (v, lo, hi, SortingAlgorithms. HeapSort, o)
1107
- return
1106
+ return v
1108
1107
end
1109
1108
1110
1109
if l_len > PDQ_SMALL_THRESHOLD
@@ -1136,7 +1135,7 @@ function pdqsort_loop!(v::AbstractVector, lo::Integer, hi::Integer, a::PatternDe
1136
1135
if was_already_partitioned &&
1137
1136
partial_insertion_sort! (v, lo, pivot_pos, o) &&
1138
1137
partial_insertion_sort! (v, pivot_pos + 1 , hi, o)
1139
- return
1138
+ return v
1140
1139
end
1141
1140
end
1142
1141
0 commit comments