replace bubble sort with timsort for cameralist, filter then sort, move global procs to cameranet datum (#89087)

## About The Pull Request

Replace bubble sort with timsort for cameralist
Move cameralist related global procs to `cameranet` datum
Other minor code cleanup things

## Why It's Good For The Game

Cameralist reads for UIs are now more performant

## Changelog

🆑
refactor: replace bubble sort with timsort for cameralist, move global
procs to `cameranet` datum
/🆑
This commit is contained in:
Gaxeer
2025-01-24 22:10:58 +02:00
committed by GitHub
parent bf0bbaed64
commit 4e3b0c1750
8 changed files with 81 additions and 87 deletions
@@ -127,15 +127,7 @@
data["network"] = network
data["mapRef"] = cam_screen.assigned_map
data["can_spy"] = !!spying
var/list/cameras = get_camera_list(network)
data["cameras"] = list()
for(var/i in cameras)
var/obj/machinery/camera/C = cameras[i]
data["cameras"] += list(list(
name = C.c_tag,
ref = REF(C),
))
data["cameras"] = GLOB.cameranet.get_available_cameras_data(network)
return data
/datum/computer_file/program/secureye/ui_act(action, params, datum/tgui/ui, datum/ui_state/state)