diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-08-19 14:25:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 14:25:35 +0200 |
commit | 7528986e4449febead9b18b6118f0b096f7cf800 (patch) | |
tree | 8e526c1403ba8d0689ab40a24165fc19d8a07e27 /src/profiler.h | |
parent | 1992db1395d9c068327a7c08bac7a24ef7112274 (diff) | |
download | minetest-7528986e4449febead9b18b6118f0b096f7cf800.tar.gz minetest-7528986e4449febead9b18b6118f0b096f7cf800.tar.bz2 minetest-7528986e4449febead9b18b6118f0b096f7cf800.zip |
Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial)
* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* C++ STL header style
* Spelling: vertice -> vertex
Diffstat (limited to 'src/profiler.h')
-rw-r--r-- | src/profiler.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/profiler.h b/src/profiler.h index 78055b0d4..6704afd51 100644 --- a/src/profiler.h +++ b/src/profiler.h @@ -42,7 +42,7 @@ extern Profiler *g_profiler; class Profiler { public: - Profiler() {} + Profiler() = default; void add(const std::string &name, float value) { @@ -80,11 +80,8 @@ public: void clear() { MutexAutoLock lock(m_mutex); - for(std::map<std::string, float>::iterator - i = m_data.begin(); - i != m_data.end(); ++i) - { - i->second = 0; + for (auto &it : m_data) { + it.second = 0; } m_avgcounts.clear(); } |