From f5bb83110829d1667ac0be4d4fbf69846cfc4559 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sat, 24 Aug 2013 01:48:54 -0400 Subject: [PATCH] Menu: Silly code optimization Always set releasedOnce to true here instead of setting it true in the case that it is false. It's almost certainly faster and clearer to always do the assignment than to incur the cost of the conditional and branch. --- src/kits/interface/Menu.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index a36cebae2f..4eb9f45105 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -1685,8 +1685,7 @@ BMenu::_Track(int* action, long start) } else if ((item = _HitTestItems(location, B_ORIGIN)) != NULL) { _UpdateStateOpenSelect(item, location, navAreaRectAbove, navAreaRectBelow, selectedTime, navigationAreaTime); - if (!releasedOnce) - releasedOnce = true; + releasedOnce = true; } else if (_OverSuper(screenLocation) && fSuper->fState != MENU_STATE_KEY_TO_SUBMENU) { fState = MENU_STATE_TRACKING; UnlockLooper();