From 164d3ea5375ef9eb0ec45b9514612f50deb5a06a Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 5 Sep 2021 10:51:18 -0400 Subject: [PATCH] detail --- src/core/CCSort.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/CCSort.ml b/src/core/CCSort.ml index cf8f4410..b8985be3 100644 --- a/src/core/CCSort.ml +++ b/src/core/CCSort.ml @@ -49,10 +49,10 @@ module Make(A : ARRAY) let insertion_sort_ a ~i:first ~j:last = if first+1 start && A.compare (get a (!j - 1)) (get a !j) > 0 do + while !j > first && A.compare (get a (!j - 1)) (get a !j) > 0 do swap a (!j - 1) !j; decr j; done;