@@ -710,6 +710,7 @@ function unguarded_insertion_sort!(v::AbstractVector, lo::Integer, hi::Integer,
710710 end
711711 v[j] = x
712712 end
713+ v
713714end
714715
715716"""
@@ -952,7 +953,6 @@ function partition_right!(v::AbstractVector, lo::Integer, hi::Integer, a::Branch
952953
953954 end
954955 return pivot_position, was_already_partitioned
955-
956956end
957957
958958"""
@@ -1007,7 +1007,6 @@ function partition_left!(v::AbstractVector, lo::Integer, hi::Integer, o::Orderin
10071007 v[pivot_position] = pivot
10081008 end
10091009 return pivot_position
1010-
10111010end
10121011
10131012# 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
10711070 else
10721071 unguarded_insertion_sort! (v, lo, hi, o)
10731072 end
1074- return
1073+ return v
10751074 end
10761075
10771076 # 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
11041103 bad_allowed -= 1
11051104 if bad_allowed == 0
11061105 sort! (v, lo, hi, SortingAlgorithms. HeapSort, o)
1107- return
1106+ return v
11081107 end
11091108
11101109 if l_len > PDQ_SMALL_THRESHOLD
@@ -1136,7 +1135,7 @@ function pdqsort_loop!(v::AbstractVector, lo::Integer, hi::Integer, a::PatternDe
11361135 if was_already_partitioned &&
11371136 partial_insertion_sort! (v, lo, pivot_pos, o) &&
11381137 partial_insertion_sort! (v, pivot_pos + 1 , hi, o)
1139- return
1138+ return v
11401139 end
11411140 end
11421141
0 commit comments