Fix two -Wrange-loop-analysis warnings. Change-Id: I7ff59507696e28ae65c7e2e22659debd731f788a Reviewed-on: https://gn-review.googlesource.com/c/gn/+/9260 Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org>
diff --git a/src/base/values.cc b/src/base/values.cc index d660365..25b10e3 100644 --- a/src/base/values.cc +++ b/src/base/values.cc
@@ -311,7 +311,7 @@ const Value* Value::FindPath(span<const std::string_view> path) const { const Value* cur = this; - for (const std::string_view component : path) { + for (const std::string_view& component : path) { if (!cur->is_dict() || (cur = cur->FindKey(component)) == nullptr) return nullptr; }
diff --git a/src/gn/input_conversion.cc b/src/gn/input_conversion.cc index 46d3dde..e82a939 100644 --- a/src/gn/input_conversion.cc +++ b/src/gn/input_conversion.cc
@@ -138,7 +138,7 @@ return Value(); case base::Value::Type::DICTIONARY: { std::unique_ptr<Scope> scope = std::make_unique<Scope>(settings); - for (const auto& it : value.DictItems()) { + for (auto it : value.DictItems()) { Value parsed_value = ParseJSONValue(settings, it.second, origin, input_file, err); if (!IsIdentifier(it.first)) {