Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Unified Diff: Source/core/css/CSSValue.h

Issue 1194073002: Expanded code in CompareCSSValuePtr to be more readable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSValue.h
diff --git a/Source/core/css/CSSValue.h b/Source/core/css/CSSValue.h
index 1c0f64f7244171c87332c0632fc4e4e7b64a6aee..d9c97a02a237386f1eec2bc83543776414e80f4b 100644
--- a/Source/core/css/CSSValue.h
+++ b/Source/core/css/CSSValue.h
@@ -217,19 +217,31 @@ inline bool compareCSSValueVector(const WillBeHeapVector<RefPtrWillBeMember<CSSV
template<typename CSSValueType>
inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<CSSValueType>& second)
{
- return first ? second && first->equals(*second) : !second;
+ if (first == second)
+ return true;
+ if (!first || !second)
+ return false;
+ return first->equals(*second);
}
template<typename CSSValueType>
inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<CSSValueType>& second)
{
- return first ? second && first->equals(*second) : !second;
+ if (first == second)
+ return true;
+ if (!first || !second)
+ return false;
+ return first->equals(*second);
}
template<typename CSSValueType>
inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<CSSValueType>& second)
{
- return first ? second && first->equals(*second) : !second;
+ if (first == second)
+ return true;
+ if (!first || !second)
+ return false;
+ return first->equals(*second);
}
#define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698