Bug 1669832 - Removed two else statements after a return in nsMenuPopupFrame.cpp r=emilio
authorpkrznaric <paulkrznaric@protonmail.com>
Sat, 24 Oct 2020 21:15:06 +0000
changeset 554347 dd21a1bcd8910ebab14ebed2b696098cf5454218
parent 554346 99964cee6df35841504661483417d29c5296927b
child 554348 2481a9cb04ac33016b4ece124f8e5c9234cb5391
push id37892
push usernbeleuzu@mozilla.com
push dateSun, 25 Oct 2020 21:41:16 +0000
treeherdermozilla-central@61c35792ca70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1669832
milestone84.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1669832 - Removed two else statements after a return in nsMenuPopupFrame.cpp r=emilio Differential Revision: https://phabricator.services.mozilla.com/D94686
layout/xul/nsMenuPopupFrame.cpp
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -2066,36 +2066,34 @@ nsMenuFrame* nsMenuPopupFrame::FindMenuW
 
   DOMTimeStamp keyTime = aKeyEvent->TimeStamp();
 
   if (charCode == 0) {
     if (keyCode == dom::KeyboardEvent_Binding::DOM_VK_BACK_SPACE) {
       if (!isMenu && !mIncrementalString.IsEmpty()) {
         mIncrementalString.SetLength(mIncrementalString.Length() - 1);
         return nullptr;
-      } else {
+      }
 #ifdef XP_WIN
-        nsCOMPtr<nsISound> soundInterface =
-            do_CreateInstance("@mozilla.org/sound;1");
-        if (soundInterface) soundInterface->Beep();
+      nsCOMPtr<nsISound> soundInterface =
+          do_CreateInstance("@mozilla.org/sound;1");
+      if (soundInterface) soundInterface->Beep();
 #endif  // #ifdef XP_WIN
-      }
     }
     return nullptr;
+  }
+  char16_t uniChar = ToLowerCase(static_cast<char16_t>(charCode));
+  if (isMenu) {
+    // Menu supports only first-letter navigation
+    mIncrementalString = uniChar;
+  } else if (IsWithinIncrementalTime(keyTime)) {
+    mIncrementalString.Append(uniChar);
   } else {
-    char16_t uniChar = ToLowerCase(static_cast<char16_t>(charCode));
-    if (isMenu) {
-      // Menu supports only first-letter navigation
-      mIncrementalString = uniChar;
-    } else if (IsWithinIncrementalTime(keyTime)) {
-      mIncrementalString.Append(uniChar);
-    } else {
-      // Interval too long, treat as new typing
-      mIncrementalString = uniChar;
-    }
+    // Interval too long, treat as new typing
+    mIncrementalString = uniChar;
   }
 
   // See bug 188199 & 192346, if all letters in incremental string are same,
   // just try to match the first one
   nsAutoString incrementalString(mIncrementalString);
   uint32_t charIndex = 1, stringLength = incrementalString.Length();
   while (charIndex < stringLength &&
          incrementalString[charIndex] == incrementalString[charIndex - 1]) {