mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +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:
@@ -35,11 +35,7 @@ namespace BlackMisc
|
||||
*/
|
||||
CKeyboardKey CKeyboardKeyList::keyForFunction(CKeyboardKey::HotkeyFunction function) const
|
||||
{
|
||||
CKeyboardKeyList keys = this->findBy(&CKeyboardKey::getFunction, function);
|
||||
if (keys.isEmpty())
|
||||
return CKeyboardKey(CKeyboardKey::HotkeyNone);
|
||||
else
|
||||
return keys[0];
|
||||
return this->findBy(&CKeyboardKey::getFunction, function).frontOrDefault({ CKeyboardKey::HotkeyNone });
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user