mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-25 12:02:42 +00:00
InputCommon/FunctionExpression: Make MakeFunctionExpression() take a std::string_view
There's nothing within this function that requires a copy of the string to be made, so we can make use of a non-owning view
This commit is contained in:
parent
ddf8abf507
commit
10fea99d80
@ -447,7 +447,7 @@ private:
|
|||||||
mutable Clock::time_point m_release_time = Clock::now();
|
mutable Clock::time_point m_release_time = Clock::now();
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<FunctionExpression> MakeFunctionExpression(std::string name)
|
std::unique_ptr<FunctionExpression> MakeFunctionExpression(std::string_view name)
|
||||||
{
|
{
|
||||||
if ("not" == name)
|
if ("not" == name)
|
||||||
return std::make_unique<NotExpression>();
|
return std::make_unique<NotExpression>();
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -47,6 +48,6 @@ private:
|
|||||||
std::vector<std::unique_ptr<Expression>> m_args;
|
std::vector<std::unique_ptr<Expression>> m_args;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<FunctionExpression> MakeFunctionExpression(std::string name);
|
std::unique_ptr<FunctionExpression> MakeFunctionExpression(std::string_view name);
|
||||||
|
|
||||||
} // namespace ciface::ExpressionParser
|
} // namespace ciface::ExpressionParser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user