/must test.nut Secret
Created
December 14, 2023 23:23
What is faster / less cpu intensive?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (_tile_priorities == null) { | |
_tile_priorities = { }; | |
for (local noise = 1; noise <= _noisiest_airport_noise; noise++) { | |
_tile_priorities[noise] <- GSList(); | |
_tile_priorities[noise].Sort(GSList.SORT_BY_VALUE, GSList.SORT_DESCENDING); | |
} | |
} | |
/* Random code here */ | |
/* Method 1 */ | |
if (_tile_priorities[noise].Count() > 0) { | |
_tile_priorities[noise].AddItem(tile, _tile_priorities[noise].GetValue(_tile_priorities[noise].Begin()) + 1); | |
} else { | |
_tile_priorities[noise].AddItem(tile, 0); | |
} | |
/* Method 2 */ | |
_tile_priorities[noise].AddItem(tile, _tile_priorities[noise].Count()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment