待辦事項 #44852

Redundant check in citizens_update()

啟用日期: 2022-06-18 05:28 最後更新: 2022-10-15 12:09

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
1

細節

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 (無) to cazfi
  • 處理結果 Update from 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
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入