@@ -705,6 +705,7 @@ function unguarded_insertion_sort!(v::AbstractVector, lo::Integer, hi::Integer,
705
705
end
706
706
v[j] = x
707
707
end
708
+ v
708
709
end
709
710
710
711
"""
@@ -947,7 +948,6 @@ function partition_right!(v::AbstractVector, lo::Integer, hi::Integer, a::Branch
947
948
948
949
end
949
950
return pivot_position, was_already_partitioned
950
-
951
951
end
952
952
953
953
"""
@@ -1002,7 +1002,6 @@ function partition_left!(v::AbstractVector, lo::Integer, hi::Integer, o::Orderin
1002
1002
v[pivot_position] = pivot
1003
1003
end
1004
1004
return pivot_position
1005
-
1006
1005
end
1007
1006
1008
1007
# midpoint was added to Base.sort in version 1.4 and later moved to Base
@@ -1066,7 +1065,7 @@ function pdqsort_loop!(v::AbstractVector, lo::Integer, hi::Integer, a::PatternDe
1066
1065
else
1067
1066
unguarded_insertion_sort! (v, lo, hi, o)
1068
1067
end
1069
- return
1068
+ return v
1070
1069
end
1071
1070
1072
1071
# Choose pivot as median of 3 or pseudomedian of 9.
@@ -1099,7 +1098,7 @@ function pdqsort_loop!(v::AbstractVector, lo::Integer, hi::Integer, a::PatternDe
1099
1098
bad_allowed -= 1
1100
1099
if bad_allowed == 0
1101
1100
sort! (v, lo, hi, SortingAlgorithms. HeapSort, o)
1102
- return
1101
+ return v
1103
1102
end
1104
1103
1105
1104
if l_len > PDQ_SMALL_THRESHOLD
@@ -1131,7 +1130,7 @@ function pdqsort_loop!(v::AbstractVector, lo::Integer, hi::Integer, a::PatternDe
1131
1130
if was_already_partitioned &&
1132
1131
partial_insertion_sort! (v, lo, pivot_pos, o) &&
1133
1132
partial_insertion_sort! (v, pivot_pos + 1 , hi, o)
1134
- return
1133
+ return v
1135
1134
end
1136
1135
end
1137
1136
0 commit comments