Bug 1406206 - Remove extraneous else block from cycle collection macros; r=ehsan draft
authorKyle Machulis <kyle@nonpolynomial.com>
Wed, 14 Mar 2018 15:36:59 -0700
changeset 767679 4f6ce54bf69989a5916775c606c4bfa4343879ac
parent 766212 d6957f004e9cc3d7408ac3a8f2b49ff97556e27f
push id102665
push userbmo:kyle@nonpolynomial.com
push dateWed, 14 Mar 2018 22:39:13 +0000
reviewersehsan
bugs1406206
milestone61.0a1
Bug 1406206 - Remove extraneous else block from cycle collection macros; r=ehsan clang-tidy is complaining about an extra else in NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION. Not hurting anything, but could be cleaned up anyways. MozReview-Commit-ID: 36Lkdhs3fyN
xpcom/base/nsCycleCollectionParticipant.h
--- a/xpcom/base/nsCycleCollectionParticipant.h
+++ b/xpcom/base/nsCycleCollectionParticipant.h
@@ -303,20 +303,19 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCyc
        LowWordEquals(aIID, NS_GET_IID(nsCycleCollectionISupports)))) {         \
     if (LowWordEquals(aIID, NS_GET_IID(nsXPCOMCycleCollectionParticipant))) {  \
       *aInstancePtr = NS_CYCLE_COLLECTION_PARTICIPANT(_class);                 \
       return NS_OK;                                                            \
     }                                                                          \
     if (LowWordEquals(aIID, NS_GET_IID(nsCycleCollectionISupports))) {         \
       *aInstancePtr = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Upcast(this);     \
       return NS_OK;                                                            \
-    } else {                                                                   \
-      /* Avoid warnings about foundInterface being left uninitialized. */      \
-      foundInterface = nullptr;                                                \
     }                                                                          \
+    /* Avoid warnings about foundInterface being left uninitialized. */        \
+    foundInterface = nullptr;                                                  \
   } else
 
 #define NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(_class)                        \
   NS_INTERFACE_MAP_BEGIN(_class)                                               \
     NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class)
 
 #define NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(_class)  \
   if (rv == NS_OK) return rv; \