Keep track of last use of variable

This commit is contained in:
WarmUpTill
2024-02-19 19:20:39 +01:00
committed by WarmUpTill
parent cb58eb9f04
commit a7da22b7e9
3 changed files with 36 additions and 4 deletions

View File

@@ -73,7 +73,9 @@ std::string SubstitueVariables(std::string str)
for (const auto &v : GetVariables()) {
const auto &variable = std::dynamic_pointer_cast<Variable>(v);
const std::string pattern = "${" + variable->Name() + "}";
ReplaceAll(str, pattern, variable->Value());
if (ReplaceAll(str, pattern, variable->Value(false))) {
variable->UpdateLastUsed();
}
}
return str;
}