mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-09 16:09:15 +00:00
* Case of lower * More changes * Ruins the nice 420 diff, brainfart when doing the second batch of conversions * More changes * Next batch. I think * Converts even more paths * Restarts bots * Capital Free Zone * Come on travis, do something * Renames areas * Bots, please stop dying * Updates CONTRIBUTING.md and updates a few paths I missed. * APC recgarftzfvas /obj/item/computer_hardware/recharger/apc to /obj/item/computer_hardware/recharger/apc_recharger
21 lines
451 B
Plaintext
21 lines
451 B
Plaintext
//TimSort interface
|
|
/proc/sortTim(list/L, cmp=/proc/cmp_numeric_asc, associative, fromIndex=1, toIndex=0)
|
|
if(L && L.len >= 2)
|
|
fromIndex = fromIndex % L.len
|
|
toIndex = toIndex % (L.len+1)
|
|
if(fromIndex <= 0)
|
|
fromIndex += L.len
|
|
if(toIndex <= 0)
|
|
toIndex += L.len + 1
|
|
|
|
var/datum/sort_instance/SI = GLOB.sortInstance
|
|
if(!SI)
|
|
SI = new
|
|
|
|
SI.L = L
|
|
SI.cmp = cmp
|
|
SI.associative = associative
|
|
|
|
SI.timSort(fromIndex, toIndex)
|
|
return L
|