procs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//simple insertion sort - generally faster than merge for runs of 7 or smaller
|
||||
/proc/sortInsert(list/L, cmp=/proc/cmp_numeric_asc, associative, fromIndex=1, toIndex=0)
|
||||
/proc/sortInsert(list/L, cmp=GLOBAL_PROC_REF(cmp_numeric_asc), associative, fromIndex=1, toIndex=0)
|
||||
if(L && L.len >= 2)
|
||||
fromIndex = fromIndex % L.len
|
||||
toIndex = toIndex % (L.len+1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//merge-sort - gernerally faster than insert sort, for runs of 7 or larger
|
||||
/proc/sortMerge(list/L, cmp=/proc/cmp_numeric_asc, associative, fromIndex=1, toIndex)
|
||||
/proc/sortMerge(list/L, cmp=GLOBAL_PROC_REF(cmp_numeric_asc), associative, fromIndex=1, toIndex)
|
||||
if(L && L.len >= 2)
|
||||
fromIndex = fromIndex % L.len
|
||||
toIndex = toIndex % (L.len+1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//TimSort interface
|
||||
/proc/sortTim(list/L, cmp=/proc/cmp_numeric_asc, associative, fromIndex=1, toIndex=0)
|
||||
/proc/sortTim(list/L, cmp=GLOBAL_PROC_REF(cmp_numeric_asc), associative, fromIndex=1, toIndex=0)
|
||||
if(L && L.len >= 2)
|
||||
fromIndex = fromIndex % L.len
|
||||
toIndex = toIndex % (L.len+1)
|
||||
|
||||
@@ -15,7 +15,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new())
|
||||
var/list/L
|
||||
|
||||
//The comparator proc-reference
|
||||
var/cmp = /proc/cmp_numeric_asc
|
||||
var/cmp = GLOBAL_PROC_REF(cmp_numeric_asc)
|
||||
|
||||
//whether we are sorting list keys (0: L[i]) or associated values (1: L[L[i]])
|
||||
var/associative = 0
|
||||
|
||||
Reference in New Issue
Block a user