From 8b2d40c0e97360103320c90dcc7ceafd4bc0619b Mon Sep 17 00:00:00 2001
From: Yagiz Nizipli <yagiz@nizipli.com>
Date: Fri, 29 Nov 2024 12:14:26 -0500
Subject: [PATCH] src: avoid copy on getV8FastApiCallCount

---
 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 <unordered_map>
 #endif  // DEBUG
 
-namespace node {
-namespace debug {
+namespace node::debug {
 
 #ifdef DEBUG
 using v8::Context;
@@ -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) {
@@ -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)