SetID(id);
}
-std::string& TreeServer::GetID()
+const std::string& TreeServer::GetID()
{
return sid;
}
return ServerName.c_str();
}
-std::string TreeServer::GetDesc()
+const std::string& TreeServer::GetDesc()
{
return ServerDesc;
}
-std::string TreeServer::GetVersion()
+const std::string& TreeServer::GetVersion()
{
return VersionString;
}
bool TreeServer::DelChild(TreeServer* Child)
{
- for (std::vector<TreeServer*>::iterator a = Children.begin(); a != Children.end(); a++)
+ std::vector<TreeServer*>::iterator it = std::find(Children.begin(), Children.end(), Child);
+ if (it != Children.end())
{
- if (*a == Child)
- {
- Children.erase(a);
- return true;
- }
+ Children.erase(it);
+ return true;
}
return false;
}