mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Allow string_view lookups in MWWorld::Store and get some use out of that
This commit is contained in:
parent
bb9884c024
commit
de51525c76
35 changed files with 205 additions and 214 deletions
|
@ -57,6 +57,8 @@ namespace Misc::StringUtils
|
|||
|
||||
struct CiEqual
|
||||
{
|
||||
using is_transparent = void;
|
||||
|
||||
bool operator()(std::string_view left, std::string_view right) const
|
||||
{
|
||||
return ciEqual(left, right);
|
||||
|
@ -65,10 +67,12 @@ namespace Misc::StringUtils
|
|||
|
||||
struct CiHash
|
||||
{
|
||||
std::size_t operator()(std::string str) const
|
||||
using is_transparent = void;
|
||||
|
||||
std::size_t operator()(std::string_view str) const
|
||||
{
|
||||
lowerCaseInPlace(str);
|
||||
return std::hash<std::string>{}(str);
|
||||
// TODO avoid string copy
|
||||
return std::hash<std::string>{}(lowerCase(str));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue