Merge pull request #1115 from Citadel-Station-13/upstream-merge-27527

[MIRROR] sortMerge fix
This commit is contained in:
LetterJay
2017-05-23 10:13:51 -05:00
committed by GitHub
+2 -3
View File
@@ -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
#undef fetchElement