From f3b1543b734e6c23b12f7d56f395f8aff5d7ec52 Mon Sep 17 00:00:00 2001 From: Huamonarch Date: Fri, 15 May 2026 16:59:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ensureVarCache=20=E7=A7=BB=E5=88=B0=20ex?= =?UTF-8?q?pression=5Fengine.h=20=E5=86=85=E8=81=94=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E6=9E=84=E9=80=A0=E5=87=BD=E6=95=B0=E4=B8=AD=E6=9C=AA?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eqpalg/utility/expression_engine.cpp | 6 ------ eqpalg/utility/expression_engine.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eqpalg/utility/expression_engine.cpp b/eqpalg/utility/expression_engine.cpp index 4687336..e4ad0c8 100644 --- a/eqpalg/utility/expression_engine.cpp +++ b/eqpalg/utility/expression_engine.cpp @@ -35,12 +35,6 @@ ExpressionEngine::ExpressionEngine(std::map& mm_vars, } } -// 惰性初始化 VarsCache(首次变量刷新时调用) -static void ensureVarCache(VarsCache& vc, size_t tag_count) { - if (vc.tag_num == 0 && tag_count > 0) { - vc.init(tag_count, 6); - } -} int ExpressionEngine::registerExpression(const std::string& name, const std::string& raw_exp_str) { diff --git a/eqpalg/utility/expression_engine.h b/eqpalg/utility/expression_engine.h index 26b0957..2b3edc0 100644 --- a/eqpalg/utility/expression_engine.h +++ b/eqpalg/utility/expression_engine.h @@ -118,6 +118,12 @@ private: VarsCache var_cache_; static constexpr size_t PV_NUM = 6; + static void ensureVarCache(VarsCache& vc, size_t tag_count) { + if (vc.tag_num == 0 && tag_count > 0) { + vc.init(tag_count, 6); + } + } + // 内部辅助 int initHoldExpStr(const std::string& exp_str); };