unit_list_iterate_safe() evaluates 'unitlist' parameter twice (sometimes); once to get its size, and if the size is above zero, second time to iterate it.
Equivalent behavior with other _iterate_safe() macros. All fixed in the attached patch. Unlikely to make much difference with current users (but I've not evaluated all of those)
unit_list_iterate_safe() evaluates 'unitlist' parameter twice (sometimes); once to get its size, and if the size is above zero, second time to iterate it.