diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-19 02:24:14 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-19 16:10:49 -0400 |
commit | da34a2b33e1f600ec11172f599384b9a92835403 (patch) | |
tree | f09a158be783f0486447d0c61750a7509760d83b /src/script/cpp_api/s_node.cpp | |
parent | 603297cc352cab685dd01dcd645999624ad17c0b (diff) | |
download | hax-minetest-server-da34a2b33e1f600ec11172f599384b9a92835403.tar.gz hax-minetest-server-da34a2b33e1f600ec11172f599384b9a92835403.zip |
Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
Diffstat (limited to '')
-rw-r--r-- | src/script/cpp_api/s_node.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/cpp_api/s_node.cpp b/src/script/cpp_api/s_node.cpp index e3d3fb58b..7df712ca0 100644 --- a/src/script/cpp_api/s_node.cpp +++ b/src/script/cpp_api/s_node.cpp @@ -200,7 +200,7 @@ bool ScriptApiNode::node_on_timer(v3s16 p, MapNode node, f32 dtime) void ScriptApiNode::node_on_receive_fields(v3s16 p, const std::string &formname, - const std::map<std::string, std::string> &fields, + const StringMap &fields, ServerActiveObject *sender) { SCRIPTAPI_PRECHECKHEADER @@ -220,8 +220,8 @@ void ScriptApiNode::node_on_receive_fields(v3s16 p, push_v3s16(L, p); // pos lua_pushstring(L, formname.c_str()); // formname lua_newtable(L); // fields - std::map<std::string, std::string>::const_iterator it; - for (it = fields.begin(); it != fields.end(); it++){ + StringMap::const_iterator it; + for (it = fields.begin(); it != fields.end(); it++) { const std::string &name = it->first; const std::string &value = it->second; lua_pushstring(L, name.c_str()); |