Keymap: Backward loop count optimization

This commit is contained in:
John Scipione
2014-02-20 15:03:42 -05:00
parent e90aead4f9
commit f97a4a3ceb
@@ -1148,7 +1148,7 @@ KeyboardLayoutView::_KeyAt(BPoint point)
keyPoint.x /= fFactor;
keyPoint.y /= fFactor;
for (int32 i = 0; i < fLayout->CountKeys(); i++) {
for (int32 i = fLayout->CountKeys() - 1; i >= 0; i--) {
Key* key = fLayout->KeyAt(i);
if (key->frame.Contains(keyPoint)) {
BRect frame = _FrameFor(key);