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

Unified Diff: Source/core/css/CSSParser-in.cpp

Issue 21678003: Remove redundant call of argsList->current() from loops in CSSParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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/CSSParser-in.cpp
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp
index e296682288bf121fad35e03714927589e9312e0a..b38112bb1936a811e1cdac454ea90779720f5505 100644
--- a/Source/core/css/CSSParser-in.cpp
+++ b/Source/core/css/CSSParser-in.cpp
@@ -8245,8 +8245,8 @@ PassRefPtr<CSSMixFunctionValue> CSSParser::parseMixFunction(CSSParserValue* valu
bool hasBlendMode = false;
bool hasAlphaCompositing = false;
- CSSParserValue* arg;
- while ((arg = argsList->current())) {
+
+ for (CSSParserValue* arg = argsList->current(); arg; arg = argsList->next()) {
RefPtr<CSSValue> value;
unsigned argNumber = argsList->currentIndex();
@@ -8269,8 +8269,6 @@ PassRefPtr<CSSMixFunctionValue> CSSParser::parseMixFunction(CSSParserValue* valu
return 0;
mixFunction->append(value.release());
-
- arg = argsList->next();
}
return mixFunction;
@@ -8425,7 +8423,7 @@ PassRefPtr<CSSFilterValue> CSSParser::parseCustomFilterFunctionWithInlineSyntax(
RefPtr<CSSValueList> shadersList = CSSValueList::createSpaceSeparated();
bool hadAtLeastOneCustomShader = false;
CSSParserValue* arg;
- while ((arg = argsList->current())) {
+ for (arg = argsList->current(); arg; arg = argsList->next()) {
RefPtr<CSSValue> value;
if (arg->id == CSSValueNone)
value = cssValuePool().createIdentifierValue(CSSValueNone);
@@ -8442,7 +8440,6 @@ PassRefPtr<CSSFilterValue> CSSParser::parseCustomFilterFunctionWithInlineSyntax(
if (!value)
break;
shadersList->append(value.release());
- argsList->next();
}
if (!shadersList->length() || !hadAtLeastOneCustomShader || shadersList->length() > 2 || !acceptCommaOperator(argsList))
@@ -8453,7 +8450,7 @@ PassRefPtr<CSSFilterValue> CSSParser::parseCustomFilterFunctionWithInlineSyntax(
// 2. Parse the mesh size <vertex-mesh>
RefPtr<CSSValueList> meshSizeList = CSSValueList::createSpaceSeparated();
- while ((arg = argsList->current())) {
+ for (arg = argsList->current(); arg; arg = argsList->next()) {
if (!validUnit(arg, FInteger | FNonNeg, CSSStrictMode))
break;
int integerValue = clampToInteger(arg->fValue);
@@ -8461,7 +8458,6 @@ PassRefPtr<CSSFilterValue> CSSParser::parseCustomFilterFunctionWithInlineSyntax(
if (integerValue < 1)
return 0;
meshSizeList->append(cssValuePool().createValue(integerValue, CSSPrimitiveValue::CSS_NUMBER));
- argsList->next();
}
if (meshSizeList->length() > 2)
« 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