Baystation12/Baystation12 — pull request #6159 by PsiOmegaDelta (2014-08-24 21:02:00+00:00)
Title: Optimization of machinery sort?

Machinery sort optimization based on comments in #6140.

When an object is added to the machinery list the flag machinery_sort_required, defined in master_controller, is set to true.
The list is assumed to remain sorted on object removal, unless BYOND has some magic logical thinking.

When the master controller eventually process machinery the flag is checked, sorting conducted if required, and then continues as always.

Sorting is done in process_machines() rather than machinery/../New(), which is how PDAs do it, to attempt to minimize the number of times sorting will be required, due to being a much larger list which is also likely to be modified more often. It also appears to be the most reasonable *process() proc to use.

The list may not always be sorted if iterated over right after a new machine has been created but this should be of no consequence.

@Ccomp5950, others, does this seem reasonable?