diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-08-19 11:30:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 11:30:46 +0200 |
commit | 1992db1395d9c068327a7c08bac7a24ef7112274 (patch) | |
tree | 3fb4982e4662a9519e08b57cab228c6b26d4a57f /src/nodetimer.cpp | |
parent | 4a1265ceb5919c53efaa8c50bbb0fe7955aa47aa (diff) | |
download | minetest-1992db1395d9c068327a7c08bac7a24ef7112274.tar.gz minetest-1992db1395d9c068327a7c08bac7a24ef7112274.tar.bz2 minetest-1992db1395d9c068327a7c08bac7a24ef7112274.zip |
Code modernization: src/n*, src/o* (#6280)
* Code modernization: src/n*, src/o*
* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* remove unused IWritableNodeDefManager::clone()
* C++ STL header style
* Pointer constness in some functions
Diffstat (limited to 'src/nodetimer.cpp')
-rw-r--r-- | src/nodetimer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nodetimer.cpp b/src/nodetimer.cpp index 003d08782..ec8611a01 100644 --- a/src/nodetimer.cpp +++ b/src/nodetimer.cpp @@ -60,12 +60,10 @@ void NodeTimerList::serialize(std::ostream &os, u8 map_format_version) const writeU16(os, m_timers.size()); } - for (std::multimap<double, NodeTimer>::const_iterator - i = m_timers.begin(); - i != m_timers.end(); ++i) { - NodeTimer t = i->second; + for (const auto &timer : m_timers) { + NodeTimer t = timer.second; NodeTimer nt = NodeTimer(t.timeout, - t.timeout - (f32)(i->first - m_time), t.position); + t.timeout - (f32)(timer.first - m_time), t.position); v3s16 p = t.position; u16 p16 = p.Z * MAP_BLOCKSIZE * MAP_BLOCKSIZE + p.Y * MAP_BLOCKSIZE + p.X; |