Ticket #44852

Redundant check in citizens_update()

Eröffnet am: 2022-06-18 05:28 Letztes Update: 2022-10-15 12:09

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
1

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-Verlauf (3/6 Historien)

2022-06-18 05:28 Aktualisiert von: ihnatus
  • New Ticket "Redundant check in citizens_update()" created
2022-08-05 08:59 Aktualisiert von: cazfi
2022-10-07 09:30 Aktualisiert von: cazfi
2022-10-08 11:02 Aktualisiert von: cazfi
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Keine to Accepted
Kommentar

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.

2022-10-15 12:09 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Anmelden