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

Unified Diff: third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp

Issue 2502413004: WTF/std normalization: replace WTF::Vector::last with ::back (Closed)
Patch Set: rebase Created 4 years, 1 month 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/parser/SizesCalcParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp b/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp
index 5f71a8ec73be4dce9c2d995d05ecfc61904d0075..0952a22f323ad993cc24911eec6b202010c03900 100644
--- a/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp
@@ -43,11 +43,11 @@ bool SizesCalcParser::handleOperator(Vector<CSSParserToken>& stack,
if (!operatorPriority(token.delimiter(), incomingOperatorPriority))
return false;
- if (!stack.isEmpty() && stack.last().type() == DelimiterToken) {
- if (!operatorPriority(stack.last().delimiter(), stackOperatorPriority))
+ if (!stack.isEmpty() && stack.back().type() == DelimiterToken) {
+ if (!operatorPriority(stack.back().delimiter(), stackOperatorPriority))
return false;
if (!incomingOperatorPriority || stackOperatorPriority) {
- appendOperator(stack.last());
+ appendOperator(stack.back());
stack.pop_back();
}
}
@@ -113,9 +113,9 @@ bool SizesCalcParser::calcToReversePolishNotation(CSSParserTokenRange range) {
// Until the token at the top of the stack is a left parenthesis, pop
// operators off the stack onto the output queue.
while (!stack.isEmpty() &&
- stack.last().type() != LeftParenthesisToken &&
- stack.last().type() != FunctionToken) {
- appendOperator(stack.last());
+ stack.back().type() != LeftParenthesisToken &&
+ stack.back().type() != FunctionToken) {
+ appendOperator(stack.back());
stack.pop_back();
}
// If the stack runs out without finding a left parenthesis, then there
@@ -164,11 +164,11 @@ bool SizesCalcParser::calcToReversePolishNotation(CSSParserTokenRange range) {
while (!stack.isEmpty()) {
// If the operator token on the top of the stack is a parenthesis, then
// there are mismatched parentheses.
- CSSParserTokenType type = stack.last().type();
+ CSSParserTokenType type = stack.back().type();
if (type == LeftParenthesisToken || type == FunctionToken)
return false;
// Pop the operator onto the output queue.
- appendOperator(stack.last());
+ appendOperator(stack.back());
stack.pop_back();
}
return true;
@@ -177,9 +177,9 @@ bool SizesCalcParser::calcToReversePolishNotation(CSSParserTokenRange range) {
static bool operateOnStack(Vector<SizesCalcValue>& stack, UChar operation) {
if (stack.size() < 2)
return false;
- SizesCalcValue rightOperand = stack.last();
+ SizesCalcValue rightOperand = stack.back();
stack.pop_back();
- SizesCalcValue leftOperand = stack.last();
+ SizesCalcValue leftOperand = stack.back();
stack.pop_back();
bool isLength;
switch (operation) {
@@ -226,8 +226,8 @@ bool SizesCalcParser::calculate() {
return false;
}
}
- if (stack.size() == 1 && stack.last().isLength) {
- m_result = std::max(clampTo<float>(stack.last().value), (float)0.0);
+ if (stack.size() == 1 && stack.back().isLength) {
+ m_result = std::max(clampTo<float>(stack.back().value), (float)0.0);
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698