refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
parent
33c271cc7c
commit
3c24b511f2
72 changed files with 1486 additions and 401 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue