1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 03:19:44 +00:00

Minor simplification in multidircollection.cpp

This commit is contained in:
jvoisin 2022-06-01 22:09:13 +02:00
parent 1a9fe98764
commit a204f392c9
2 changed files with 2 additions and 31 deletions

View File

@ -16,22 +16,7 @@ namespace Files
{
if (mStrict)
return left==right;
std::size_t len = left.length();
if (len!=right.length())
return false;
for (std::size_t i=0; i<len; ++i)
{
char l = Misc::StringUtils::toLower (left[i]);
char r = Misc::StringUtils::toLower (right[i]);
if (l!=r)
return false;
}
return true;
return Misc::StringUtils::ciEqual(left, right);
}
};

View File

@ -24,21 +24,7 @@ namespace Files
{
if (mStrict)
return left<right;
std::size_t min = std::min (left.length(), right.length());
for (std::size_t i=0; i<min; ++i)
{
char l = Misc::StringUtils::toLower (left[i]);
char r = Misc::StringUtils::toLower (right[i]);
if (l<r)
return true;
if (l>r)
return false;
}
return left.length()<right.length();
return Misc::StringUtils::ciLess(left, right);
}
};