refactor(Core/Misc): add braces and impove codestyle (#6402)

This commit is contained in:
Kargatum
2021-06-25 00:50:18 +07:00
committed by GitHub
parent 33c271cc7c
commit 3c24b511f2
72 changed files with 1486 additions and 401 deletions

View File

@@ -13,19 +13,26 @@ Str Acore::String::Trim(const Str& s, const std::locale& loc /*= std::locale()*/
typename Str::const_iterator end = s.end();
while (first != end && std::isspace(*first, loc))
{
++first;
}
if (first == end)
{
return Str();
}
typename Str::const_iterator last = end;
do
{
--last;
while (std::isspace(*last, loc));
} while (std::isspace(*last, loc));
if (first != s.begin() || last + 1 != end)
{
return Str(first, last + 1);
}
return s;
}