diff options
Diffstat (limited to 'libs/ardour/port_manager.cc')
-rw-r--r-- | libs/ardour/port_manager.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index e4c066944f..5b8693e548 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -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(); - - len = portname.length(); + string::size_type colon = portname.find (':'); - 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; |