Skip to content

Commit

Permalink
Merge pull request tgstation#27527 from cerid/patch-1
Browse files Browse the repository at this point in the history
sortMerge fix
  • Loading branch information
lzimann authored May 23, 2017
2 parents 82d5e8a + 9008f8a commit 4d0c708
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions code/__HELPERS/sorts/__main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -653,4 +652,4 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new())
#undef MIN_GALLOP
#undef MIN_MERGE

#undef fetchElement
#undef fetchElement

0 comments on commit 4d0c708

Please sign in to comment.