mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Merge pull request #1709 from ap29600/quicksort_fix
Fix tail recursion in `_quick_sort_general`
This commit is contained in:
@@ -150,7 +150,7 @@ _quick_sort_general :: proc(data: $T/[]$E, a, b, max_depth: int, call: $P, $KIND
|
|||||||
|
|
||||||
a, b, max_depth := a, b, max_depth
|
a, b, max_depth := a, b, max_depth
|
||||||
|
|
||||||
if b-a > 12 { // only use shell sort for lengths <= 12
|
for b-a > 12 { // only use shell sort for lengths <= 12
|
||||||
if max_depth == 0 {
|
if max_depth == 0 {
|
||||||
heap_sort(data, a, b, call)
|
heap_sort(data, a, b, call)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user