summaryrefslogtreecommitdiff
path: root/src/content_mapnode.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-17 23:02:50 +0200
committerGitHub <noreply@github.com>2017-08-17 23:02:50 +0200
commit13e995b811e80dc48c0769274d3dca3a2221b843 (patch)
treeb75e58314fa98b57d23fefd92547f298ea419e5f /src/content_mapnode.cpp
parent921151d97a2fb2238ab514324fb95e2732248b96 (diff)
downloadminetest-13e995b811e80dc48c0769274d3dca3a2221b843.tar.gz
minetest-13e995b811e80dc48c0769274d3dca3a2221b843.tar.bz2
minetest-13e995b811e80dc48c0769274d3dca3a2221b843.zip
Modernize src/c* src/d* and src/e* files (#6263)
* Modernize src/c* src/d* and src/e* files * default operator * redundant init * delete default constructors on CraftDefinition childs (never used) * fix some missing init values * const ref fix reported by clang-tidy * ranged-based for loops * simple conditions & returns * empty stl function instead of size * emplace_back stl function instead of push_back + construct temp obj * auto for some iterators * code style fixes * c++ stl headers instead of C stl headers (stdio.h -> cstdio)
Diffstat (limited to 'src/content_mapnode.cpp')
-rw-r--r--src/content_mapnode.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp
index a6bf0a82d..6da5f45ad 100644
--- a/src/content_mapnode.cpp
+++ b/src/content_mapnode.cpp
@@ -108,11 +108,9 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version)
if(version <= 19)
{
content_t c_from = n_from.getContent();
- for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++)
- {
- if(trans_table_19[i][1] == c_from)
- {
- result.setContent(trans_table_19[i][0]);
+ for (const auto &tt_i : trans_table_19) {
+ if (tt_i[1] == c_from) {
+ result.setContent(tt_i[0]);
break;
}
}