mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
use unordered containers where possible (patch 4 on X)
Also remove some unused parameters/functions
This commit is contained in:
parent
b66a5d2f88
commit
155288ee98
13 changed files with 63 additions and 99 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue