Bug 1674611 - Removed the use of 'else' after 'return'. r=mak
authorAnkush Singhal <ankushsinghal1995@gmail.com>
Tue, 17 Nov 2020 15:09:40 +0000
changeset 557565 45e9724d1432b7570d13148c64a9f96b9b11d0fb
parent 557564 08bdfc1659dac54e215f88c0225f6ac99080929a
child 557566 fa49d5e4c9cf9c41592114754bd3509afc728170
push id37959
push userbtara@mozilla.com
push dateTue, 17 Nov 2020 21:55:29 +0000
treeherdermozilla-central@9dd0b13d77b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1674611
milestone85.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 1674611 - Removed the use of 'else' after 'return'. r=mak Removed the 'else' block after the return statement in the 'if' block Differential Revision: https://phabricator.services.mozilla.com/D97314
toolkit/components/places/nsNavHistoryResult.cpp
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -3410,37 +3410,38 @@ nsNavHistoryFolderResultNode::OnItemMove
       return NS_ERROR_FAILURE;
     }
     MOZ_ASSERT(index < uint32_t(mChildren.Count()), "Invalid index!");
     node->mBookmarkIndex = aNewIndex;
 
     // adjust position
     EnsureItemPosition(index);
     return NS_OK;
-  } else {
-    // moving between two different folders, just do a remove and an add
-    nsCOMPtr<nsIURI> itemURI;
-    if (aItemType == nsINavBookmarksService::TYPE_BOOKMARK) {
-      nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
-      NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
-      nsresult rv = bookmarks->GetBookmarkURI(aItemId, getter_AddRefs(itemURI));
-      NS_ENSURE_SUCCESS(rv, rv);
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-    if (aOldParent == mTargetFolderItemId) {
-      OnItemRemoved(aItemId, aOldParent, aOldIndex, aItemType, itemURI, aGUID,
-                    aOldParentGUID, aSource);
-    }
-    if (aNewParent == mTargetFolderItemId) {
-      OnItemAdded(
-          aItemId, aNewParent, aNewIndex, aItemType, itemURI,
-          RoundedPRNow(),  // This is a dummy dateAdded, not the real value.
-          aGUID, aNewParentGUID, aSource);
-    }
+  }
+
+  // moving between two different folders, just do a remove and an add
+  nsCOMPtr<nsIURI> itemURI;
+  if (aItemType == nsINavBookmarksService::TYPE_BOOKMARK) {
+    nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
+    NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
+    nsresult rv = bookmarks->GetBookmarkURI(aItemId, getter_AddRefs(itemURI));
+    NS_ENSURE_SUCCESS(rv, rv);
+    NS_ENSURE_SUCCESS(rv, rv);
   }
+  if (aOldParent == mTargetFolderItemId) {
+    OnItemRemoved(aItemId, aOldParent, aOldIndex, aItemType, itemURI, aGUID,
+                  aOldParentGUID, aSource);
+  }
+  if (aNewParent == mTargetFolderItemId) {
+    OnItemAdded(
+        aItemId, aNewParent, aNewIndex, aItemType, itemURI,
+        RoundedPRNow(),  // This is a dummy dateAdded, not the real value.
+        aGUID, aNewParentGUID, aSource);
+  }
+
   return NS_OK;
 }
 
 /**
  * Separator nodes do not hold any data.
  */
 nsNavHistorySeparatorResultNode::nsNavHistorySeparatorResultNode()
     : nsNavHistoryResultNode(""_ns, ""_ns, 0, 0) {}