scummvm/scummvm — comment on commit 8e79608a1de77c54cc6bf0eb23b32b1cc3175677
File:  line 0
By wjp:

If we would have a priority queue implementation, that would've been the perfect data structure to use, I think.

Insertions and deletions are very rare, and iterations over the list in priority order happen on the order of 100 times per second. Keeping it sorted by priority will cut the number of iterations by a factor 8.