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

@@ -8,6 +8,7 @@
#define NAZARA_GRAPHICS_MATERIALPASSREGISTRY_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <NazaraUtils/StringHash.hpp>
#include <list>
#include <string>
#include <unordered_map>
@@ -30,8 +31,7 @@ namespace Nz
MaterialPassRegistry& operator=(MaterialPassRegistry&&) = default;
private:
std::list<std::string> m_passNames; //< in order to allow std::string_view as a key in C++17 (keep std::string stable as well because of SSO)
std::unordered_map<std::string_view, std::size_t> m_passIndex;
std::unordered_map<std::string, std::size_t, StringHash<>, std::equal_to<>> m_passIndex;
};
}