diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-07 13:16:22 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-07 13:17:49 -0400 |
commit | 7675739f4509e60f8519b4acb3998617d7e5e08d (patch) | |
tree | dde79b39203142c992644c73761ee62e0f646082 | |
parent | 38405fa21047e6b7b69aa5a2de0ac95566e6b402 (diff) |
use C++ for PortManager::make_port_name_relative()
-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; |