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

Unified Diff: third_party/WebKit/Source/core/css/CSSValueList.cpp

Issue 2033583006: Change CSSValueList::removeAll and hasValue to take const CSSValue& (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
Index: third_party/WebKit/Source/core/css/CSSValueList.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSValueList.cpp b/third_party/WebKit/Source/core/css/CSSValueList.cpp
index ea85b73b0cf86ec14e57099638d66736ff08535a..42dc823762e27446773f1f50da9a2a3a3bd9393a 100644
--- a/third_party/WebKit/Source/core/css/CSSValueList.cpp
+++ b/third_party/WebKit/Source/core/css/CSSValueList.cpp
@@ -38,12 +38,12 @@ CSSValueList::CSSValueList(ValueListSeparator listSeparator)
m_valueListSeparator = listSeparator;
}
-bool CSSValueList::removeAll(CSSValue* val)
+bool CSSValueList::removeAll(const CSSValue& val)
{
bool found = false;
for (int index = m_values.size() - 1; index >= 0; --index) {
Member<CSSValue>& value = m_values.at(index);
- if (value && val && value->equals(*val)) {
+ if (value && value->equals(val)) {
m_values.remove(index);
found = true;
}
@@ -52,11 +52,11 @@ bool CSSValueList::removeAll(CSSValue* val)
return found;
}
-bool CSSValueList::hasValue(CSSValue* val) const
+bool CSSValueList::hasValue(const CSSValue& val) const
{
for (size_t index = 0; index < m_values.size(); index++) {
const Member<CSSValue>& value = m_values.at(index);
- if (value && val && value->equals(*val))
+ if (value && value->equals(val))
return true;
}
return false;
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValueList.h ('k') | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698