Quote:
Originally Posted by PRoSToTeM@
Where can I use them?
|
Let us suppose:
- You are developing a map chooser plugin.
- You need to sort 5 maps from a map list.
- You do not want to sort the map map twice for performance questions.
For each map you sort you must to check whether they meet several criteria as:
- The map prefix as `de_` must to be unique on the menu.
- The map not to be present on the recent maps list.
- The map must to to be present to the current hourly blocked list.
So, sorting the same number, on the map index range is processing lost, so would be nice not to sort repeated numbers.
Also the other approach would be to remove all the maps from the map list so we can just sort any.
However this has the following characteristics:
You would have to duplicate the map list as it can be used for other map voting.
You would have to remove the duplicated prefixes from the maps list while duplicating.
You would have to remove the maps from the recent list and hourly list, while duplicating it.
So, I just to choose the first implementation, instead of the second one.
May be the second is trivially better than the first, or otherwise.
Anyways, I already got the second implementation fully working.
So, I would not spend my time doing the second one, if the first one
is not lacking or creating performance problems which cannot be dealt with.
__________________