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

Side by Side Diff: tools/gn/function_process_file_template.cc

Issue 610293003: Replace more for loops in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « tools/gn/function_get_target_outputs.cc ('k') | tools/gn/function_rebase_path.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/functions.h" 5 #include "tools/gn/functions.h"
6 #include "tools/gn/parse_tree.h" 6 #include "tools/gn/parse_tree.h"
7 #include "tools/gn/scope.h" 7 #include "tools/gn/scope.h"
8 #include "tools/gn/settings.h" 8 #include "tools/gn/settings.h"
9 #include "tools/gn/substitution_list.h" 9 #include "tools/gn/substitution_list.h"
10 #include "tools/gn/substitution_writer.h" 10 #include "tools/gn/substitution_writer.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 *err = Err(template_arg, "Not a string or a list."); 91 *err = Err(template_arg, "Not a string or a list.");
92 return Value(); 92 return Value();
93 } 93 }
94 94
95 SubstitutionWriter::ApplyListToSourcesAsString( 95 SubstitutionWriter::ApplyListToSourcesAsString(
96 scope->settings(), subst, input_files, &result_files); 96 scope->settings(), subst, input_files, &result_files);
97 97
98 // Convert the list of strings to the return Value. 98 // Convert the list of strings to the return Value.
99 Value ret(function, Value::LIST); 99 Value ret(function, Value::LIST);
100 ret.list_value().reserve(result_files.size()); 100 ret.list_value().reserve(result_files.size());
101 for (size_t i = 0; i < result_files.size(); i++) 101 for (const auto& file : result_files)
102 ret.list_value().push_back(Value(function, result_files[i])); 102 ret.list_value().push_back(Value(function, file));
103 103
104 return ret; 104 return ret;
105 } 105 }
106 106
107 } // namespace functions 107 } // namespace functions
OLDNEW
« no previous file with comments | « tools/gn/function_get_target_outputs.cc ('k') | tools/gn/function_rebase_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698