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

Unified Diff: tools/gn/function_foreach.cc

Issue 1884503003: GN: Replace vector<ParseNode*> with vector<unique_ptr<ParseNode>> in parse_tree.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove comments Created 4 years, 8 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 | « tools/gn/command_format.cc ('k') | tools/gn/function_forward_variables_from.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_foreach.cc
diff --git a/tools/gn/function_foreach.cc b/tools/gn/function_foreach.cc
index 549ebe407c1ec93287922ab29ecb5ab9c22baa54..b74fc186af115c95ad951c7bd2c5389ba6ce4697 100644
--- a/tools/gn/function_foreach.cc
+++ b/tools/gn/function_foreach.cc
@@ -47,7 +47,7 @@ Value RunForEach(Scope* scope,
const FunctionCallNode* function,
const ListNode* args_list,
Err* err) {
- const std::vector<const ParseNode*>& args_vector = args_list->contents();
+ const auto& args_vector = args_list->contents();
if (args_vector.size() != 2) {
*err = Err(function, "Wrong number of arguments to foreach().",
"Expecting exactly two.");
@@ -57,7 +57,8 @@ Value RunForEach(Scope* scope,
// Extract the loop variable.
const IdentifierNode* identifier = args_vector[0]->AsIdentifier();
if (!identifier) {
- *err = Err(args_vector[0], "Expected an identifier for the loop var.");
+ *err =
+ Err(args_vector[0].get(), "Expected an identifier for the loop var.");
return Value();
}
base::StringPiece loop_var(identifier->value().value());
@@ -69,7 +70,7 @@ Value RunForEach(Scope* scope,
if (list_identifier) {
list_value = scope->GetValue(list_identifier->value().value(), true);
if (!list_value) {
- *err = Err(args_vector[1], "Undefined identifier.");
+ *err = Err(args_vector[1].get(), "Undefined identifier.");
return Value();
}
} else {
« no previous file with comments | « tools/gn/command_format.cc ('k') | tools/gn/function_forward_variables_from.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698