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>
This commit is contained in:
parent
16aee380a5
commit
7016ee658a
@ -63,7 +63,7 @@ void NodeCategorySet::Enable(const FunctionCallbackInfo<Value>& args) {
|
|||||||
NodeCategorySet* category_set;
|
NodeCategorySet* category_set;
|
||||||
ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder());
|
ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder());
|
||||||
CHECK_NE(category_set, nullptr);
|
CHECK_NE(category_set, nullptr);
|
||||||
auto categories = category_set->GetCategories();
|
const auto& categories = category_set->GetCategories();
|
||||||
if (!category_set->enabled_ && !categories.empty()) {
|
if (!category_set->enabled_ && !categories.empty()) {
|
||||||
env->tracing_agent()->Enable(categories);
|
env->tracing_agent()->Enable(categories);
|
||||||
category_set->enabled_ = true;
|
category_set->enabled_ = true;
|
||||||
@ -75,7 +75,7 @@ void NodeCategorySet::Disable(const FunctionCallbackInfo<Value>& args) {
|
|||||||
NodeCategorySet* category_set;
|
NodeCategorySet* category_set;
|
||||||
ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder());
|
ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder());
|
||||||
CHECK_NE(category_set, nullptr);
|
CHECK_NE(category_set, nullptr);
|
||||||
auto categories = category_set->GetCategories();
|
const auto& categories = category_set->GetCategories();
|
||||||
if (category_set->enabled_ && !categories.empty()) {
|
if (category_set->enabled_ && !categories.empty()) {
|
||||||
env->tracing_agent()->Disable(categories);
|
env->tracing_agent()->Disable(categories);
|
||||||
category_set->enabled_ = false;
|
category_set->enabled_ = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user