mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user