To change fewer things with the master implementation, the Id isn't changed to lower case on creation

lower case utility functions used in comparison functions
This commit is contained in:
florent.teppe 2022-11-04 17:21:22 +01:00
parent 65cdd489fb
commit d49f60d2d6
4 changed files with 22 additions and 7 deletions

View file

@ -8,17 +8,17 @@ namespace ESM
{
bool RefId::operator==(const RefId& rhs) const
{
return this->mId == rhs.mId;
return Misc::StringUtils::ciEqual(mId, rhs.mId);
}
bool RefId::operator<(const RefId& rhs) const
{
return mId < rhs.mId;
return Misc::StringUtils::ciLess(mId, rhs.mId);
}
bool RefId::operator>(const RefId& rhs) const
{
return mId > rhs.mId;
return Misc::StringUtils::ciMore(mId, rhs.mId);
}
std::ostream& operator<<(std::ostream& os, const RefId& refId)
@ -30,7 +30,7 @@ namespace ESM
RefId RefId::stringRefId(std::string_view id)
{
RefId newRefId;
newRefId.mId = Misc::StringUtils::lowerCase(id);
newRefId.mId = id;
return newRefId;
}
@ -41,3 +41,8 @@ namespace ESM
const RefId RefId::sEmpty = {};
}
std::size_t std::hash<ESM::RefId>::operator()(const ESM::RefId& k) const
{
return Misc::StringUtils::CiHash()(k.getRefIdString());
}