[Freeciv-tickets] [freeciv] #42883: advance_index_iterate(): Move advance_count() call outside the loop

アーカイブの一覧に戻る
OSDN Ticket System norep****@osdn*****
Thu Sep 30 19:50:59 JST 2021


#42883: advance_index_iterate(): Move advance_count() call outside the loop

  Open Date: 2021-09-19 15:28
Last Update: 2021-09-30 13:50

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/42883
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=42883

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2021-09-30 13:50 Updated by: cazfi
 * Status Update from Open to Closed
 * Owner Update from (None) to cazfi
 * Resolution Update from Accepted to Fixed


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: cazfi
          Type: Patches
        Status: Closed
      Priority: 5 - Medium
     MileStone: 2.6.6
     Component: General
      Severity: 5 - Medium
    Resolution: Fixed
---------------------------------------------------------------------

Ticket details:

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 )

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/42883
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=42883



More information about the Freeciv-tickets mailing list
アーカイブの一覧に戻る