From 2804502615939981c9f1b0397969c293886c6499 Mon Sep 17 00:00:00 2001 From: "rdevlin.cronin" Date: Thu, 5 Jan 2017 08:01:54 -0800 Subject: [PATCH] [V8] Run clang-tidy performance-for-range-copy check on src/ BUG=None Review-Url: https://codereview.chromium.org/2609173005 Cr-Commit-Position: refs/heads/master@{#42094} --- src/compilation-statistics.cc | 4 ++-- src/compiler/js-create-lowering.cc | 2 +- src/compiler/js-native-context-specialization.cc | 2 +- src/libplatform/tracing/trace-config.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compilation-statistics.cc b/src/compilation-statistics.cc index 654807cc31..16ab3b37fe 100644 --- a/src/compilation-statistics.cc +++ b/src/compilation-statistics.cc @@ -134,10 +134,10 @@ std::ostream& operator<<(std::ostream& os, const AsPrintableStatistics& ps) { } if (!ps.machine_output) WriteHeader(os); - for (auto phase_kind_it : sorted_phase_kinds) { + for (const auto& phase_kind_it : sorted_phase_kinds) { const auto& phase_kind_name = phase_kind_it->first; if (!ps.machine_output) { - for (auto phase_it : sorted_phases) { + for (const auto& phase_it : sorted_phases) { const auto& phase_stats = phase_it->second; if (phase_stats.phase_kind_name_ != phase_kind_name) continue; const auto& phase_name = phase_it->first; diff --git a/src/compiler/js-create-lowering.cc b/src/compiler/js-create-lowering.cc index 32279368c7..839338ec5c 100644 --- a/src/compiler/js-create-lowering.cc +++ b/src/compiler/js-create-lowering.cc @@ -1253,7 +1253,7 @@ Node* JSCreateLowering::AllocateFastLiteral( AccessBuilder::ForJSArrayLength(boilerplate_array->GetElementsKind()), handle(boilerplate_array->length(), isolate())); } - for (auto const inobject_field : inobject_fields) { + for (auto const& inobject_field : inobject_fields) { builder.Store(inobject_field.first, inobject_field.second); } return builder.Finish(); diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc index e9ccc0c464..76eed6554f 100644 --- a/src/compiler/js-native-context-specialization.cc +++ b/src/compiler/js-native-context-specialization.cc @@ -247,7 +247,7 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess( // TODO(turbofan): Add support for inlining into try blocks. bool is_exceptional = NodeProperties::IsExceptionalCall(node); - for (auto access_info : access_infos) { + for (const auto& access_info : access_infos) { if (access_info.IsAccessorConstant()) { // Accessor in try-blocks are not supported yet. if (is_exceptional || !(flags() & kAccessorInliningEnabled)) { diff --git a/src/libplatform/tracing/trace-config.cc b/src/libplatform/tracing/trace-config.cc index 9156301a45..ff90eff71c 100644 --- a/src/libplatform/tracing/trace-config.cc +++ b/src/libplatform/tracing/trace-config.cc @@ -25,7 +25,7 @@ bool TraceConfig::IsCategoryGroupEnabled(const char* category_group) const { while (category_stream.good()) { std::string category; getline(category_stream, category, ','); - for (auto included_category : included_categories_) { + for (const auto& included_category : included_categories_) { if (category == included_category) return true; } }