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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user