mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Fix profiler assertion failures
oops
This commit is contained in:
parent
b7887a339d
commit
3bd5169aee
2 changed files with 8 additions and 2 deletions
|
@ -96,7 +96,7 @@ void Profiler::avg(const std::string &name, float value)
|
|||
if (it == m_data.end()) {
|
||||
m_data.emplace(name, DataPair{value, 1});
|
||||
} else {
|
||||
assert(it->second.avgcount >= 1);
|
||||
assert(it->second.avgcount >= 0);
|
||||
it->second.value += value;
|
||||
it->second.avgcount++;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ void Profiler::clear()
|
|||
{
|
||||
MutexAutoLock lock(m_mutex);
|
||||
for (auto &it : m_data)
|
||||
it.second = DataPair();
|
||||
it.second.reset();
|
||||
m_start_time = porting::getTimeMs();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue