2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 16:24:55 +00:00

Console: Use emplace in registerCommand()

Allows avoiding a redundant initial element. We can also remove the
const from the std::function rvalue to allow a std::move to take effect.

We can also use the std::string_view constructor for std::string to
avoid an unnecessary strlen() call.
This commit is contained in:
Lioncash
2019-10-21 01:03:27 -04:00
parent cbd40382bf
commit 5d2987588b
2 changed files with 10 additions and 5 deletions

View File

@@ -81,7 +81,7 @@ private:
public:
Console(CVarManager*);
void registerCommand(std::string_view name, std::string_view helpText, std::string_view usage,
const std::function<void(Console*, const std::vector<std::string>&)>&& func,
std::function<void(Console*, const std::vector<std::string>&)>&& func,
SConsoleCommand::ECommandFlags cmdFlags = SConsoleCommand::ECommandFlags::Normal);
void unregisterCommand(std::string_view name);