From bab2670eb4462cac8335288500d79c614f2d77d9 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 30 Sep 2023 01:46:03 +0300 Subject: [PATCH 58/58] Limit extra iteration on get_tile_infrastructure_set() For better performance, do not iterate over all extras but only over those with correct rmcause. See osdn #48525 Signed-off-by: Marko Lindqvist --- common/map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/map.c b/common/map.c index 48c1ca26e6..449a3f8223 100644 --- a/common/map.c +++ b/common/map.c @@ -106,8 +106,8 @@ bv_extras get_tile_infrastructure_set(const struct tile *ptile, BV_CLR_ALL(pspresent); - extra_type_iterate(pextra) { - if (is_extra_removed_by(pextra, ERM_PILLAGE) && tile_has_extra(ptile, pextra)) { + extra_type_by_rmcause_iterate(ERM_PILLAGE, pextra) { + if (tile_has_extra(ptile, pextra)) { struct tile *missingset = tile_virtual_new(ptile); bool dependency = FALSE; @@ -131,7 +131,7 @@ bv_extras get_tile_infrastructure_set(const struct tile *ptile, count++; } } - } extra_type_iterate_end; + } extra_type_by_rmcause_iterate_end; if (pcount) { *pcount = count; -- 2.40.1