Skip to content

Conversation

@Pirulax
Copy link
Contributor

@Pirulax Pirulax commented May 21, 2020

As the name states it, this PR modifies all
std::map<const char*, lua_CFunction> functions to
constexpr static const std::pair<const char*, lua_CFunction> functions[]
so it can be inlined.
Also the last commit modifies all idk what it was to

for (const auto& [name, func] : functions)
    CLuaCFunctions::AddFunction(name, func);

@ghost
Copy link

ghost commented May 21, 2020

This is really good.

@qaisjp qaisjp changed the title Refactor ::LoadFunctions() to use array instead of std::map so it can be inlined Refactor LuaDef::LoadFunctions() to use array instead of map for inlining May 21, 2020
@qaisjp qaisjp merged commit 36efacb into multitheftauto:master May 21, 2020
@qaisjp qaisjp added this to the 1.5.8 milestone May 21, 2020
@Pirulax
Copy link
Contributor Author

Pirulax commented May 22, 2020

This is really good.

Thanks!

@Pirulax Pirulax deleted the refactor/LoadFunctions branch May 22, 2020 01:26
Pirulax added a commit to Pirulax/mtasa-blue that referenced this pull request May 23, 2020
@Pirulax Pirulax restored the refactor/LoadFunctions branch October 2, 2020 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants