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

@@ -18,13 +18,11 @@ namespace Nz
inline std::size_t MaterialPassRegistry::RegisterPass(std::string passName)
{
if (m_passIndex.find(passName) != m_passIndex.end())
if (m_passIndex.contains(passName))
throw std::runtime_error("pass " + passName + " is already registered");
m_passNames.push_back(std::move(passName));
std::size_t passIndex = m_passIndex.size();
m_passIndex.emplace(m_passNames.back(), passIndex);
m_passIndex.emplace(std::move(passName), passIndex);
return passIndex;
}