aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2016-10-06 19:20:12 +0200
committersfan5 <sfan5@live.de>2016-10-06 22:37:26 +0200
commit155288ee981c70f505526347cb2bcda4df1c8e6b (patch)
tree582095bc50cb60d3dedb9f6a08e908324a3da365 /src/script
parentb66a5d2f8842cc84ae44257dc0ead255e5b0538f (diff)
downloadminetest-155288ee981c70f505526347cb2bcda4df1c8e6b.tar.gz
minetest-155288ee981c70f505526347cb2bcda4df1c8e6b.tar.bz2
minetest-155288ee981c70f505526347cb2bcda4df1c8e6b.zip
use unordered containers where possible (patch 4 on X)
Also remove some unused parameters/functions
Diffstat (limited to 'src/script')
-rw-r--r--src/script/cpp_api/s_async.cpp3
-rw-r--r--src/script/cpp_api/s_async.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/script/cpp_api/s_async.cpp b/src/script/cpp_api/s_async.cpp
index 9bf3fcf49..1fb84fab6 100644
--- a/src/script/cpp_api/s_async.cpp
+++ b/src/script/cpp_api/s_async.cpp
@@ -81,6 +81,7 @@ bool AsyncEngine::registerFunction(const char* name, lua_CFunction func)
if (initDone) {
return false;
}
+
functionList[name] = func;
return true;
}
@@ -203,7 +204,7 @@ void AsyncEngine::pushFinishedJobs(lua_State* L) {
/******************************************************************************/
void AsyncEngine::prepareEnvironment(lua_State* L, int top)
{
- for (std::map<std::string, lua_CFunction>::iterator it = functionList.begin();
+ for (UNORDERED_MAP<std::string, lua_CFunction>::iterator it = functionList.begin();
it != functionList.end(); it++) {
lua_pushstring(L, it->first.c_str());
lua_pushcfunction(L, it->second);
diff --git a/src/script/cpp_api/s_async.h b/src/script/cpp_api/s_async.h
index 8d612d58c..016381e5f 100644
--- a/src/script/cpp_api/s_async.h
+++ b/src/script/cpp_api/s_async.h
@@ -132,7 +132,7 @@ private:
bool initDone;
// Internal store for registred functions
- std::map<std::string, lua_CFunction> functionList;
+ UNORDERED_MAP<std::string, lua_CFunction> functionList;
// Internal counter to create job IDs
unsigned int jobIdCounter;