fix port-sort order for good.
TODO find out how to make std::set::find() work with custom sort order, as std::find may only be O(N) and not O(log (N)).
This commit is contained in:
parent
97b1725023
commit
ac923be7af
|
@ -1362,7 +1362,7 @@ AlsaAudioBackend::unregister_port (PortEngine::PortHandle port_handle)
|
|||
return;
|
||||
}
|
||||
AlsaPort* port = static_cast<AlsaPort*>(port_handle);
|
||||
PortIndex::iterator i = _ports.find (static_cast<AlsaPort*>(port_handle));
|
||||
PortIndex::iterator i = std::find (_ports.begin(), _ports.end(), static_cast<AlsaPort*>(port_handle));
|
||||
if (i == _ports.end ()) {
|
||||
PBD::error << _("AlsaBackend::unregister_port: Failed to find port") << endmsg;
|
||||
return;
|
||||
|
|
|
@ -454,7 +454,7 @@ class AlsaAudioBackend : public AudioBackend {
|
|||
}
|
||||
|
||||
bool valid_port (PortHandle port) const {
|
||||
return _ports.find (static_cast<AlsaPort*>(port)) != _ports.end ();
|
||||
return std::find (_ports.begin(), _ports.end(), static_cast<AlsaPort*>(port)) != _ports.end ();
|
||||
}
|
||||
|
||||
AlsaPort* find_port (const std::string& port_name) const {
|
||||
|
|
|
@ -1054,7 +1054,7 @@ CoreAudioBackend::unregister_port (PortEngine::PortHandle port_handle)
|
|||
return;
|
||||
}
|
||||
CoreBackendPort* port = static_cast<CoreBackendPort*>(port_handle);
|
||||
PortIndex::iterator i = _ports.find (static_cast<CoreBackendPort*>(port_handle));
|
||||
PortIndex::iterator i = std::find (_ports.begin(), _ports.end(), static_cast<CoreBackendPort*>(port_handle));
|
||||
if (i == _ports.end ()) {
|
||||
PBD::warning << _("CoreAudioBackend::unregister_port: Failed to find port") << endmsg;
|
||||
return;
|
||||
|
|
|
@ -505,7 +505,7 @@ class CoreAudioBackend : public AudioBackend {
|
|||
}
|
||||
|
||||
bool valid_port (PortHandle port) const {
|
||||
return _ports.find (static_cast<CoreBackendPort*>(port)) != _ports.end ();
|
||||
return std::find (_ports.begin(), _ports.end(), static_cast<CoreBackendPort*>(port)) != _ports.end ();
|
||||
}
|
||||
|
||||
CoreBackendPort* find_port (const std::string& port_name) const {
|
||||
|
|
|
@ -809,7 +809,7 @@ DummyAudioBackend::unregister_port (PortEngine::PortHandle port_handle)
|
|||
return;
|
||||
}
|
||||
DummyPort* port = static_cast<DummyPort*>(port_handle);
|
||||
PortIndex::iterator i = _ports.find (static_cast<DummyPort*>(port_handle));
|
||||
PortIndex::iterator i = std::find (_ports.begin(), _ports.end(), static_cast<DummyPort*>(port_handle));
|
||||
if (i == _ports.end ()) {
|
||||
PBD::error << _("DummyBackend::unregister_port: Failed to find port") << endmsg;
|
||||
return;
|
||||
|
|
|
@ -490,7 +490,7 @@ class DummyAudioBackend : public AudioBackend {
|
|||
}
|
||||
|
||||
bool valid_port (PortHandle port) const {
|
||||
return _ports.find (static_cast<DummyPort*>(port)) != _ports.end ();
|
||||
return std::find (_ports.begin(), _ports.end(), static_cast<DummyPort*>(port)) != _ports.end ();
|
||||
}
|
||||
|
||||
DummyPort* find_port (const std::string& port_name) const {
|
||||
|
|
Loading…
Reference in New Issue
Block a user