OLD | NEW |
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 Loading... |
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 |
OLD | NEW |