From 683d9b37867546b7f05d5e3b95549ff300628e3b Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 20 Jul 2016 10:12:07 -0700 Subject: [PATCH] Revert "Check list in a reverse order #2765" This reverts commit 3de98a2f44a20449468496d47f5642b534a80cf6. --- src/lib/synergy/KeyMap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/synergy/KeyMap.cpp b/src/lib/synergy/KeyMap.cpp index 8833c2b5..1fff2c58 100644 --- a/src/lib/synergy/KeyMap.cpp +++ b/src/lib/synergy/KeyMap.cpp @@ -692,7 +692,7 @@ KeyMap::findBestKey(const KeyEntryList& entryList, KeyModifierMask desiredState) const { // check for an item that can accommodate the desiredState exactly - for (SInt32 i = (SInt32)entryList.size() - 1; i >= 0; --i) { + for (SInt32 i = 0; i < (SInt32)entryList.size(); ++i) { const KeyItem& item = entryList[i].back(); if ((item.m_required & desiredState) == (item.m_sensitive & desiredState)) { @@ -704,7 +704,7 @@ KeyMap::findBestKey(const KeyEntryList& entryList, // choose the item that requires the fewest modifier changes SInt32 bestCount = 32; SInt32 bestIndex = -1; - for (SInt32 i = (SInt32)entryList.size() - 1; i >= 0; --i) { + for (SInt32 i = 0; i < (SInt32)entryList.size(); ++i) { const KeyItem& item = entryList[i].back(); KeyModifierMask change = ((item.m_required ^ desiredState) & item.m_sensitive);