From a49c65517a227818503c4143d348fd09f93db153 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 27 Apr 2018 15:21:17 +0200 Subject: [PATCH] src: remove unnecessary copy operations in tracing code --- src/node_trace_events.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 1e02048d1f0843..f37537d54544a2 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -63,7 +63,7 @@ void NodeCategorySet::Enable(const FunctionCallbackInfo& args) { NodeCategorySet* category_set; ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder()); CHECK_NE(category_set, nullptr); - auto categories = category_set->GetCategories(); + const auto& categories = category_set->GetCategories(); if (!category_set->enabled_ && !categories.empty()) { env->tracing_agent()->Enable(categories); category_set->enabled_ = true; @@ -75,7 +75,7 @@ void NodeCategorySet::Disable(const FunctionCallbackInfo& args) { NodeCategorySet* category_set; ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder()); CHECK_NE(category_set, nullptr); - auto categories = category_set->GetCategories(); + const auto& categories = category_set->GetCategories(); if (category_set->enabled_ && !categories.empty()) { env->tracing_agent()->Disable(categories); category_set->enabled_ = false;