Skip to content

Commit

Permalink
src: avoid copy on getV8FastApiCallCount
Browse files Browse the repository at this point in the history
PR-URL: #56081
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
anonrig authored and targos committed Dec 2, 2024
1 parent a8809fc commit 4dea44e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/node_debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include <unordered_map>
#endif // DEBUG

namespace node {
namespace debug {
namespace node::debug {

#ifdef DEBUG
using v8::Context;
Expand Down Expand Up @@ -41,7 +40,7 @@ void GetV8FastApiCallCount(const FunctionCallbackInfo<Value>& args) {
return;
}
Utf8Value utf8_key(env->isolate(), args[0]);
args.GetReturnValue().Set(GetV8FastApiCallCount(utf8_key.ToString()));
args.GetReturnValue().Set(GetV8FastApiCallCount(utf8_key.ToStringView()));
}

void SlowIsEven(const FunctionCallbackInfo<Value>& args) {
Expand Down Expand Up @@ -93,8 +92,7 @@ void Initialize(Local<Object> target,
}
#endif // DEBUG

} // namespace debug
} // namespace node
} // namespace node::debug

#ifdef DEBUG
NODE_BINDING_CONTEXT_AWARE_INTERNAL(debug, node::debug::Initialize)
Expand Down

0 comments on commit 4dea44e

Please sign in to comment.