Code cleanup: Sorting (#83017)

## About The Pull Request
1. Removes code duplication 
2. Fully documents `sortTim()`
3. Makes a define with default sortTim behavior, straight and to the
point for 95% of cases
4. Migrates other sorts into the same file
5. Removes some redundancy where they're reassigning a variable using an
in place sorter

For the record, we only use timSort
## Why It's Good For The Game
More documentation, easier to read, uses `length` over `len`, etc
Should be no gameplay effect at all
This commit is contained in:
Jeremiah
2024-05-04 20:33:52 -07:00
committed by GitHub
parent 618bd422da
commit e766f921f6
17 changed files with 108 additions and 73 deletions
+1 -1
View File
@@ -765,7 +765,7 @@ ADMIN_VERB(reestablish_tts_connection, R_DEBUG, "Re-establish Connection To TTS"
var/list/sorted = list()
for (var/source in per_source)
sorted += list(list("source" = source, "count" = per_source[source]))
sorted = sortTim(sorted, GLOBAL_PROC_REF(cmp_timer_data))
sortTim(sorted, GLOBAL_PROC_REF(cmp_timer_data))
// Now that everything is sorted, compile them into an HTML output
var/output = "<table border='1'>"