summaryrefslogtreecommitdiff
path: root/src/nameidmapping.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-19 11:30:46 +0200
committerGitHub <noreply@github.com>2017-08-19 11:30:46 +0200
commit1992db1395d9c068327a7c08bac7a24ef7112274 (patch)
tree3fb4982e4662a9519e08b57cab228c6b26d4a57f /src/nameidmapping.cpp
parent4a1265ceb5919c53efaa8c50bbb0fe7955aa47aa (diff)
downloadminetest-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/nameidmapping.cpp')
-rw-r--r--src/nameidmapping.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nameidmapping.cpp b/src/nameidmapping.cpp
index 78e4a0a56..bd5bb1fc8 100644
--- a/src/nameidmapping.cpp
+++ b/src/nameidmapping.cpp
@@ -25,10 +25,9 @@ void NameIdMapping::serialize(std::ostream &os) const
{
writeU8(os, 0); // version
writeU16(os, m_id_to_name.size());
- for (IdToNameMap::const_iterator i = m_id_to_name.begin();
- i != m_id_to_name.end(); ++i) {
- writeU16(os, i->first);
- os << serializeString(i->second);
+ for (const auto &i : m_id_to_name) {
+ writeU16(os, i.first);
+ os << serializeString(i.second);
}
}