mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-14 11:52:39 +00:00
* maps, tgui, tools * defines and helpers * onclick and controllers * datums fucking caught that hulk reversal too. * game and shuttle modular * module/admin * oh god they fucking moved antag shit again * haaaaate. Haaaaaaaaaate. * enables moff wings * more modules things * tgstation.dme before I forget something important * some mob stuff * s'more mob/living stuff * some carbon stuff * ayy lmaos and kitchen meat * Human stuff * species things moff wings have a 'none' version too * the rest of the module stuff. * some strings * misc * mob icons * some other icons. * It compiles FUCK BORERS FUCK BORERS
19 lines
524 B
Plaintext
19 lines
524 B
Plaintext
//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)
|
|
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/sortInstance/SI = GLOB.sortInstance
|
|
if(!SI)
|
|
SI = new
|
|
SI.L = L
|
|
SI.cmp = cmp
|
|
SI.associative = associative
|
|
|
|
SI.binarySort(fromIndex, toIndex, fromIndex)
|
|
return L |