mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-07 04:11:55 +01:00
0ffa8303a7
* refactor: Rename all non-snake_case types (not procs or vars (yet)). * completely dynamic update script * might help to include the data * update aa's scuffed python * oh * set script PR number * run updatepaths again * Add other table updates with JSON columns * bump SQL version * just fucking end my life * move JSON data
21 lines
490 B
Plaintext
21 lines
490 B
Plaintext
//TimSort interface
|
|
/proc/sortTim(list/L, cmp = GLOBAL_PROC_REF(cmp_numeric_asc), associative, fromIndex = 1, toIndex = 0)
|
|
if(L && length(L) >= 2)
|
|
fromIndex = fromIndex % length(L)
|
|
toIndex = toIndex % (length(L) + 1)
|
|
if(fromIndex <= 0)
|
|
fromIndex += length(L)
|
|
if(toIndex <= 0)
|
|
toIndex += length(L) + 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
|