advance_index_iterate() terminates when index variable reaches advance_count(). The advance_count() is called for the check each and every round of the iteration. That's a lot of unnecessary function call overhead. We should call it just once, outside the loop, and place the result in a variable to use inside the loop.
There's currently gcc-12 trouble with advance_index_iterate() involved. Maybe we should wait that to get resolved first, though I think it's a compiler, not freeciv, bug. ( Filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102405 )
There's currently gcc-12 trouble with advance_index_iterate() involved. Maybe we should wait that to get resolved first, though I think it's a compiler, not freeciv, bug.
Gcc considered it not-a-bug, so we have to handle that ourselves -> #42885
advance_index_iterate() terminates when index variable reaches advance_count(). The advance_count() is called for the check each and every round of the iteration. That's a lot of unnecessary function call overhead. We should call it just once, outside the loop, and place the result in a variable to use inside the loop.
There's currently gcc-12 trouble with advance_index_iterate() involved. Maybe we should wait that to get resolved first, though I think it's a compiler, not freeciv, bug. ( Filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102405 )