From 554c2fe0a67523cb89d4460b798159b2d6240fd6 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 29 Oct 2023 23:22:25 +0200 Subject: [PATCH 33/33] AI: Get advance_count() only once in suggest_tech_exchange() See osdn #48678 Signed-off-by: Marko Lindqvist --- ai/default/daidiplomacy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ai/default/daidiplomacy.c b/ai/default/daidiplomacy.c index 3ef8550385..f28b6c9f23 100644 --- a/ai/default/daidiplomacy.c +++ b/ai/default/daidiplomacy.c @@ -1158,9 +1158,9 @@ static void suggest_tech_exchange(struct ai_type *ait, { struct research *presearch1 = research_get(player1); struct research *presearch2 = research_get(player2); - int worth[advance_count()]; - bool is_dangerous; Tech_type_id ac = advance_count(); + int worth[ac]; + bool is_dangerous; worth[A_NONE] = 0; -- 2.42.0