Fix additional unsigned sub overflow bug

This commit is contained in:
ayazhafiz 2022-01-10 21:57:29 -05:00
parent b5225c87d8
commit 4ea91b54eb

View File

@ -30,7 +30,10 @@ quicksortHelp = \list, order, low, high ->
when partition low high list order is
Pair partitionIndex partitioned ->
partitioned
|> quicksortHelp order low (partitionIndex - 1)
|> \lst ->
# TODO: this will be nicer if we have Num.subSaturated
high1 = if partitionIndex == 0 then 0 else partitionIndex - 1
quicksortHelp lst order low high1
|> quicksortHelp order (partitionIndex + 1) high
else
list