From 6c60631f1f390ec0a42a87f4495f980de0fe6d75 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 22 May 2017 22:09:43 -0500 Subject: [PATCH] sortMerge fix --- code/__HELPERS/sorts/__main.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/sorts/__main.dm b/code/__HELPERS/sorts/__main.dm index c26126c0a6..7da17da503 100644 --- a/code/__HELPERS/sorts/__main.dm +++ b/code/__HELPERS/sorts/__main.dm @@ -626,14 +626,13 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) var/val2 = fetchElement(L,cursor2) while(1) - if(call(cmp)(val1,val2) < 0) + if(call(cmp)(val1,val2) <= 0) if(++cursor1 >= end1) break val1 = fetchElement(L,cursor1) else moveElement(L,cursor2,cursor1) - ++cursor2 if(++cursor2 >= end2) break ++end1 @@ -653,4 +652,4 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) #undef MIN_GALLOP #undef MIN_MERGE -#undef fetchElement \ No newline at end of file +#undef fetchElement