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.
This commit is contained in:
John Scipione
2013-08-24 01:58:12 -04:00
parent 4e075e0f4c
commit f5bb831108
+1 -2
View File
@@ -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();