From e2497c341c72ca5f2f5c51b8172ae7a6e0819d99 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sun, 1 Dec 2024 12:27:16 -0500 Subject: [PATCH] src: avoid copy on getV8FastApiCallCount MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/56081 Reviewed-By: James M Snell Reviewed-By: Michaël Zasso Reviewed-By: Juan José Arboleda Reviewed-By: Luigi Pinca --- src/node_debug.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/node_debug.cc b/src/node_debug.cc index d87cdf61d2d92d..0f254b1fbfe820 100644 --- a/src/node_debug.cc +++ b/src/node_debug.cc @@ -12,8 +12,7 @@ #include #endif // DEBUG -namespace node { -namespace debug { +namespace node::debug { #ifdef DEBUG using v8::Context; @@ -41,7 +40,7 @@ void GetV8FastApiCallCount(const FunctionCallbackInfo& 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& args) { @@ -93,8 +92,7 @@ void Initialize(Local target, } #endif // DEBUG -} // namespace debug -} // namespace node +} // namespace node::debug #ifdef DEBUG NODE_BINDING_CONTEXT_AWARE_INTERNAL(debug, node::debug::Initialize)