From 17d6e514d24b65366063f2a474e54d921b0440fd Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 10 Oct 2023 00:51:05 +0300 Subject: [PATCH 35/36] Simplify city_total_unit_gold_upkeep() Remove check against empty supported units list before iterating it as the iteration of empty list will not do anything anyway. See osdn #48433 Signed-off-by: Marko Lindqvist --- common/city.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/city.c b/common/city.c index 1aa4928c6b..4613b79a10 100644 --- a/common/city.c +++ b/common/city.c @@ -1190,7 +1190,7 @@ int city_total_impr_gold_upkeep(const struct city *pcity) { int gold_needed = 0; - if (!pcity) { + if (pcity == NULL) { return 0; } @@ -1209,8 +1209,7 @@ int city_total_unit_gold_upkeep(const struct city *pcity) { int gold_needed = 0; - if (!pcity || !pcity->units_supported - || unit_list_size(pcity->units_supported) < 1) { + if (pcity == NULL || pcity->units_supported == NULL) { return 0; } -- 2.42.0