From 2a47b52e8082d8e776429151ca343c2077386746 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 10 Sep 2025 15:13:06 +0200 Subject: [PATCH] got rid of some redundant code in `simplecpp::preprocess()` --- simplecpp.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index 94ee2fa7..a3b71982 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -3694,16 +3694,13 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL tok = tmp->previous; } try { + const long long result = evaluate(expr, dui, sizeOfType); + conditionIsTrue = (result != 0); if (ifCond) { std::string E; for (const simplecpp::Token *tok = expr.cfront(); tok; tok = tok->next) E += (E.empty() ? "" : " ") + tok->str(); - const long long result = evaluate(expr, dui, sizeOfType); - conditionIsTrue = (result != 0); ifCond->emplace_back(rawtok->location, E, result); - } else { - const long long result = evaluate(expr, dui, sizeOfType); - conditionIsTrue = (result != 0); } } catch (const std::runtime_error &e) { if (outputList) {