Bug 1381844: Remove a few redundant casts. draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 21 Jul 2017 02:31:49 +0200
changeset 613794 d0e8a0fb8a87addd7a17fcfc545f28c08e3cca30
parent 613793 82375c7805072ba367c9cd0eccaca728112729fc
child 613795 5daf67667a2f2d5eee0a400fb5175111fea2f274
push id69846
push userbmo:emilio+bugs@crisal.io
push dateSat, 22 Jul 2017 16:15:30 +0000
bugs1381844
milestone56.0a1
Bug 1381844: Remove a few redundant casts. MozReview-Commit-ID: 2dr72PMGKwN
layout/style/nsStyleContextInlines.h
--- a/layout/style/nsStyleContextInlines.h
+++ b/layout/style/nsStyleContextInlines.h
@@ -83,17 +83,17 @@ const nsStyle##name_ * nsStyleContext::D
       /* We always cache inherited structs on the context when we */\
       /* compute them. */                                           \
       return nullptr;                                               \
     }                                                               \
     /* Have the rulenode deal */                                    \
     AUTO_CHECK_DEPENDENCY(gecko, eStyleStruct_##name_);             \
     const nsStyle##name_ * newData =                                \
       gecko->RuleNode()->                                           \
-        GetStyle##name_<aComputeData>(this->AsGecko(), mBits);      \
+        GetStyle##name_<aComputeData>(gecko, mBits);                \
     /* always cache inherited data on the style context; the rule */\
     /* node set the bit in mBits for us if needed. */               \
     gecko->mCachedInheritedData                                     \
       .mStyleStructs[eStyleStruct_##name_] =                        \
       const_cast<nsStyle##name_ *>(newData);                        \
     return newData;                                                 \
   }                                                                 \
   auto servo = AsServo();                                           \
@@ -150,18 +150,18 @@ const nsStyle##name_ * nsStyleContext::D
     if (gecko->mCachedResetData) {                                            \
       const nsStyle##name_ * cachedData =                                     \
         static_cast<nsStyle##name_*>(                                         \
           gecko->mCachedResetData->mStyleStructs[eStyleStruct_##name_]);      \
       if (cachedData) /* Have it cached already, yay */                       \
         return cachedData;                                                    \
     }                                                                         \
     /* Have the rulenode deal */                                              \
-    AUTO_CHECK_DEPENDENCY(gecko, eStyleStruct_##name_);                              \
-    return gecko->RuleNode()->GetStyle##name_<aComputeData>(this->AsGecko()); \
+    AUTO_CHECK_DEPENDENCY(gecko, eStyleStruct_##name_);                       \
+    return gecko->RuleNode()->GetStyle##name_<aComputeData>(gecko);           \
   }                                                                           \
   auto servo = AsServo();                                                     \
   const bool needToCompute = !(mBits & NS_STYLE_INHERIT_BIT(name_));          \
   if (!aComputeData && needToCompute) {                                       \
     return nullptr;                                                           \
   }                                                                           \
   const nsStyle##name_* data =                                                \
     servo->ComputedData()->GetStyle##name_();                               \