lib/upnp/Util: use std::string::erase() instead of ..::replace()

This commit is contained in:
Max Kellermann 2018-01-02 13:04:11 +01:00
parent 28c5e7e6a7
commit 7d96883d64

View File

@ -30,11 +30,11 @@ trimstring(std::string &s, const char *ws) noexcept
s.clear(); s.clear();
return; return;
} }
s.replace(0, pos, std::string()); s.erase(0, pos);
pos = s.find_last_not_of(ws); pos = s.find_last_not_of(ws);
if (pos != std::string::npos && pos != s.length()-1) if (pos != std::string::npos && pos != s.length()-1)
s.replace(pos + 1, std::string::npos, std::string()); s.erase(pos + 1);
} }
static void static void