neutrino use check empty() instead of length() or size()

This commit is contained in:
Jacek Jendrzej
2015-01-03 17:51:08 +01:00
parent a92eb8f8e7
commit 8023a6317b
14 changed files with 26 additions and 26 deletions

View File

@@ -179,7 +179,7 @@ CUPnPDevice::CUPnPDevice(std::string url)
if (!strcmp(node->GetType(),"URLBase"))
{
urlbase = std::string(node->GetData());
if ((urlbase.length() > 0) && (urlbase[urlbase.length()-1] == '/'))
if ((!urlbase.empty() ) && (urlbase[urlbase.length()-1] == '/'))
urlbase.erase(urlbase.length()-1);
}

View File

@@ -136,7 +136,7 @@ std::vector<CUPnPDevice> CUPnPSocket::Discover(std::string service)
if (!strcasecmp(location.c_str(), "location:"))
{
line.erase(0, 9);
while ((line.length() > 0 )&& ((line[0] == ' ') || (line[0] == '\t')))
while ((!line.empty()) && ((line[0] == ' ') || (line[0] == '\t')))
line.erase(0, 1);
if (line.substr(0,7) == "http://")
{