Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/node_trace_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, I consistently forget that the const and & are still required with auto.

if (!category_set->enabled_ && !categories.empty()) {
env->tracing_agent()->Enable(categories);
category_set->enabled_ = true;
Expand All @@ -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;
Expand Down