summaryrefslogtreecommitdiff
path: root/src/genericobject.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-08-18 07:44:42 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-08-18 07:44:52 +0200
commit55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e (patch)
treea7b06056f0905327351131de60678f41a1283826 /src/genericobject.cpp
parent13e995b811e80dc48c0769274d3dca3a2221b843 (diff)
downloadminetest-55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e.tar.gz
minetest-55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e.tar.bz2
minetest-55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e.zip
Modernize various files
* range-based for loops * emplace_back instead of push_back * code style * C++ headers instead of C headers * Default operators * empty stl function
Diffstat (limited to 'src/genericobject.cpp')
-rw-r--r--src/genericobject.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/genericobject.cpp b/src/genericobject.cpp
index 58f4b997e..15977b0e0 100644
--- a/src/genericobject.cpp
+++ b/src/genericobject.cpp
@@ -109,10 +109,9 @@ std::string gob_cmd_update_armor_groups(const ItemGroupList &armor_groups)
std::ostringstream os(std::ios::binary);
writeU8(os, GENERIC_CMD_UPDATE_ARMOR_GROUPS);
writeU16(os, armor_groups.size());
- for(ItemGroupList::const_iterator i = armor_groups.begin();
- i != armor_groups.end(); ++i){
- os<<serializeString(i->first);
- writeS16(os, i->second);
+ for (const auto &armor_group : armor_groups) {
+ os<<serializeString(armor_group.first);
+ writeS16(os, armor_group.second);
}
return os.str();
}