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