#44797: kill_unit() constantly calling player_slot_count() Open Date: 2022-06-11 15:47 Last Update: 2022-06-21 16:53 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/44797 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44797 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-06-21 16:53 Updated by: cazfi * Owner Update from (None) to cazfi * Resolution Update from None to Accepted --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: cazfi Type: Bugs Status: Open [Owner assigned] Priority: 5 - Medium MileStone: 3.0.3 Component: Server Severity: 5 - Medium Resolution: Accepted --------------------------------------------------------------------- Ticket details: kill_unit() calls player_slot_count() many times. The value returned will be the same every time, so should just call it once, and store the value in a variable. This should also help with some clang analyzer warnings that alerted me to this issue - compiler cannot know that each of those calls return the same value. -- 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/44797 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44797