Skip to content

Commit 39a0bb5

Browse files
author
Your Name
committed
Dont use lambda initializer
1 parent 3c8db85 commit 39a0bb5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/programmemory.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,11 @@ ProgramMemoryState::FindChangedFn ProgramMemoryState::getCachedFindExpressionCha
575575
// skipDeadCode adds the dead-code walk; it evaluates guards against a fixed state snapshot (so every
576576
// variable follows the same path) and memoizes those evals in evalCache for the closure's lifetime.
577577
using EvalCache = std::map<const Token*, std::vector<MathLib::bigint>>;
578-
return [cache = changedCache, sp = &settings, snapshot = (skipDeadCode ? state : ProgramMemory{}), skipDeadCode, evalCache = std::make_shared<EvalCache>()](const Token* expr, const Token* start, const Token* end) -> const Token* {
578+
const std::shared_ptr<ChangedCache> cache = changedCache;
579+
const Settings* const sp = &settings;
580+
ProgramMemory snapshot = skipDeadCode ? state : ProgramMemory{};
581+
const std::shared_ptr<EvalCache> evalCache = std::make_shared<EvalCache>();
582+
return [cache, sp, snapshot, skipDeadCode, evalCache](const Token* expr, const Token* start, const Token* end) -> const Token* {
579583
const auto key = std::make_tuple(expr, start, end);
580584
const auto it = cache->find(key);
581585
const Token* modified = (it != cache->end())

0 commit comments

Comments
 (0)