Clear token cache on flush and add cache key comment

This commit is contained in:
kemo
2026-03-11 07:33:04 +01:00
parent b7c107bfcb
commit 5869888656
@@ -253,6 +253,7 @@ class Calculation extends CalculationLocale
{
$this->clearCalculationCache();
$this->branchPruner->clearBranchStore();
self::$formulaTokenCache = [];
}
/**
@@ -616,6 +617,8 @@ class Calculation extends CalculationLocale
if (count(self::$formulaTokenCache) >= self::$formulaTokenCacheMaxSize) {
self::$formulaTokenCache = [];
}
// Cache key is the original formula string (before ANCHORARRAY transformation)
// to ensure consistent lookup regardless of internal transformations.
self::$formulaTokenCache[$originalFormula] = $result;
return $result;