mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #290 using a CRange of iterator adaptors in implementating the tertiary predicate-based methods of the derived containers,
but preserving the return-by-copy for API stability
This commit is contained in:
@@ -27,13 +27,7 @@ namespace BlackMisc
|
||||
*/
|
||||
CAudioDeviceList CAudioDeviceList::getOutputDevices() const
|
||||
{
|
||||
CAudioDeviceList outList;
|
||||
if (this->isEmpty()) return outList;
|
||||
foreach(CAudioDevice device, *this)
|
||||
{
|
||||
if (device.getType() == CAudioDevice::OutputDevice) outList.push_back(device);
|
||||
}
|
||||
return outList;
|
||||
return this->findBy(&CAudioDevice::getType, CAudioDevice::OutputDevice);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -41,13 +35,7 @@ namespace BlackMisc
|
||||
*/
|
||||
CAudioDeviceList CAudioDeviceList::getInputDevices() const
|
||||
{
|
||||
CAudioDeviceList inList;
|
||||
if (this->isEmpty()) return inList;
|
||||
foreach(CAudioDevice device, *this)
|
||||
{
|
||||
if (device.getType() == CAudioDevice::InputDevice) inList.push_back(device);
|
||||
}
|
||||
return inList;
|
||||
return this->findBy(&CAudioDevice::getType, CAudioDevice::InputDevice);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user