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 <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
anonrig authored Dec 1, 2024
1 parent 3f9c6c0 commit de5f91d
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 de5f91d

Please sign in to comment.