#44852: Redundant check in citizens_update() Open Date: 2022-06-17 23:28 Last Update: 2022-10-08 05:02 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/44852 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44852 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-10-08 05:02 Updated by: cazfi * Owner Update from (None) to cazfi * Resolution Update from None to Accepted Comment: Considered adjusting the check to at least to work correctly (use 'count - 1') but went for complete removal in the end. That also allowed integrating previously separate 'count--'. A bit undecided, but proposing this patch now anyway. --------------------------------------------------------------------- Ticket Status: Reporter: ihnatus Owner: cazfi Type: Bugs Status: Open [Owner assigned] Priority: 5 - Medium MileStone: 3.0.5 Component: Server Severity: 5 - Medium Resolution: Accepted --------------------------------------------------------------------- Ticket details: int selected = fc_rand(count); ... if (selected != count) is always true. That does not change the result (just sometimes we assign a thing to itself) but is redundant. -- 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/44852 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44852