Ticket #44852

Redundant check in citizens_update()

오픈 날짜: 2022-06-18 05:28 마지막 업데이트: 2022-10-15 12:09

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
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 History (3/6 Histories)

2022-06-18 05:28 Updated by: ihnatus
  • New Ticket "Redundant check in citizens_update()" created
2022-08-05 08:59 Updated by: cazfi
2022-10-07 09:30 Updated by: cazfi
2022-10-08 11:02 Updated by: cazfi
  • 소유자 Update from (None) to cazfi
  • Resolution Update from None to Accepted
댓글 올리기

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 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login