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_mainmenu.cpp | |
parent | 603297cc352cab685dd01dcd645999624ad17c0b (diff) | |
download | minetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.gz minetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.bz2 minetest-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 'src/script/cpp_api/s_mainmenu.cpp')
-rw-r--r-- | src/script/cpp_api/s_mainmenu.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/cpp_api/s_mainmenu.cpp b/src/script/cpp_api/s_mainmenu.cpp index ef8cea6c9..0bb247fa0 100644 --- a/src/script/cpp_api/s_mainmenu.cpp +++ b/src/script/cpp_api/s_mainmenu.cpp @@ -53,7 +53,7 @@ void ScriptApiMainMenu::handleMainMenuEvent(std::string text) scriptError(); } -void ScriptApiMainMenu::handleMainMenuButtons(std::map<std::string, std::string> fields) +void ScriptApiMainMenu::handleMainMenuButtons(const StringMap &fields) { SCRIPTAPI_PRECHECKHEADER @@ -69,8 +69,8 @@ void ScriptApiMainMenu::handleMainMenuButtons(std::map<std::string, std::string> // Convert fields to a Lua table lua_newtable(L); - 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()); |