use C++ for PortManager::make_port_name_relative()

This commit is contained in:
Paul Davis
2015-10-07 13:16:22 -04:00
parent 38405fa210
commit 7675739f45

View File

@@ -75,20 +75,14 @@ PortManager::make_port_name_relative (const string& portname) const
return portname;
}
string::size_type len;
string::size_type n;
string self = _backend->my_name();
string::size_type colon = portname.find (':');
len = portname.length();
for (n = 0; n < len; ++n) {
if (portname[n] == ':') {
break;
}
if (colon == string::npos) {
return portname;
}
if ((n != len) && (portname.substr (0, n) == self)) {
return portname.substr (n+1);
if (portname.substr (0, colon) == _backend->my_name()) {
return portname.substr (colon+1);
}
return portname;