Ticket #44797

kill_unit() constantly calling player_slot_count()

Open Date: 2022-06-11 21:47 Last Update: 2022-06-29 06:25

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

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 History (3/4 Histories)

2022-06-11 21:47 Updated by: cazfi
  • New Ticket "kill_unit() constantly calling player_slot_count()" created
2022-06-21 22:53 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
2022-06-29 06:25 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