diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-04-27 16:21:17 +0300 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2018-04-28 09:27:17 +0300 |
commit | 7016ee658a117f1172eb38a921d6fc93c594e76e (patch) | |
tree | 0e7ac8249b0550228369cbebaf59059ffe65ffa1 /src/node_trace_events.cc | |
parent | 16aee380a53bb839617bc2daf6c9b61564208906 (diff) |
src: remove unnecessary copy operations in tracing
PR-URL: https://github.com/nodejs/node/pull/20356
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'src/node_trace_events.cc')
-rw-r--r-- | src/node_trace_events.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 1e02048d1f0..f37537d5454 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -63,7 +63,7 @@ void NodeCategorySet::Enable(const FunctionCallbackInfo<Value>& 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<Value>& 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; |