Optimize out a lot of std::string construction and allocations (#415)

Update CommandLineParameters.hpp

Update CommandLineParametersTests.cpp

Update WebContext.hpp

xmake check-files -f

Fix MaterialPassRegistry
This commit is contained in:
Jérôme Leclercq
2023-12-30 14:50:57 +01:00
committed by GitHub
parent f7c9060364
commit 79ec135af7
57 changed files with 219 additions and 210 deletions

View File

@@ -6,7 +6,7 @@
namespace Nz
{
inline bool CommandLineParameters::GetParameter(const std::string& name, std::string_view* value) const
inline bool CommandLineParameters::GetParameter(std::string_view name, std::string_view* value) const
{
auto it = m_parameters.find(name);
if (it == m_parameters.end())
@@ -18,9 +18,9 @@ namespace Nz
return true;
}
inline bool CommandLineParameters::HasFlag(const std::string& flag) const
inline bool CommandLineParameters::HasFlag(std::string_view flag) const
{
return m_flags.find(flag) != m_flags.end();
return m_flags.contains(flag);
}
inline bool CommandLineParameters::operator==(const CommandLineParameters& params) const