From 4ea91b54eb974a73a2495a0a5e0ff5df09213bb5 Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Mon, 10 Jan 2022 21:57:29 -0500 Subject: [PATCH] Fix additional unsigned sub overflow bug --- examples/benchmarks/Quicksort.roc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/benchmarks/Quicksort.roc b/examples/benchmarks/Quicksort.roc index 2267e45013..7605407c4a 100644 --- a/examples/benchmarks/Quicksort.roc +++ b/examples/benchmarks/Quicksort.roc @@ -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