Skip to content

Commit 31812ed

Browse files
addaleaxMylesBorins
authored andcommitted
src: remove unnecessary copy operations in tracing
PR-URL: #20356 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
1 parent 3962c73 commit 31812ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_trace_events.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void NodeCategorySet::Enable(const FunctionCallbackInfo<Value>& args) {
6363
NodeCategorySet* category_set;
6464
ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder());
6565
CHECK_NE(category_set, nullptr);
66-
auto categories = category_set->GetCategories();
66+
const auto& categories = category_set->GetCategories();
6767
if (!category_set->enabled_ && !categories.empty()) {
6868
env->tracing_agent()->Enable(categories);
6969
category_set->enabled_ = true;
@@ -75,7 +75,7 @@ void NodeCategorySet::Disable(const FunctionCallbackInfo<Value>& args) {
7575
NodeCategorySet* category_set;
7676
ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder());
7777
CHECK_NE(category_set, nullptr);
78-
auto categories = category_set->GetCategories();
78+
const auto& categories = category_set->GetCategories();
7979
if (category_set->enabled_ && !categories.empty()) {
8080
env->tracing_agent()->Disable(categories);
8181
category_set->enabled_ = false;

0 commit comments

Comments
 (0)