Fix Value.h

This commit is contained in:
Yunfan Li
2024-03-04 18:59:41 +08:00
parent 3db6f05eb7
commit ca1fa16eb7

View File

@@ -54,19 +54,19 @@ class CalculatedValue : public UntypedValue, public Value<T>
T Get() override T Get() override
{ {
if (checkInterval < 2) { if (checkInterval < 2) {
PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr); // PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr);
value = Calculate(); value = Calculate();
if (pmo) // if (pmo)
pmo->finish(); // pmo->finish();
} else { } else {
time_t now = getMSTime(); time_t now = getMSTime();
if (!lastCheckTime || now - lastCheckTime >= checkInterval) if (!lastCheckTime || now - lastCheckTime >= checkInterval)
{ {
lastCheckTime = now; lastCheckTime = now;
PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr); // PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr);
value = Calculate(); value = Calculate();
if (pmo) // if (pmo)
pmo->finish(); // pmo->finish();
} }
} }
return value; return value;