From 135e1e3b0bc25a1d2b2055988c176403bc5e98f7 Mon Sep 17 00:00:00 2001 From: XadillaX Date: Thu, 8 Jun 2017 21:12:11 +0800 Subject: [PATCH] src: merge `fn_name` in NODE_SET_PROTOTYPE_METHOD Merge two duplicate `fn_name` into one in NODE_SET_PROTOTYPE_METHOD, it may improve a bit performance. PR-URL: https://github.com/nodejs/node/pull/13547 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- src/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.h b/src/node.h index 55ad8031104d3c..103ff98709a395 100644 --- a/src/node.h +++ b/src/node.h @@ -282,7 +282,7 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local recv, v8::FunctionTemplate::New(isolate, callback, v8::Local(), s); v8::Local fn_name = v8::String::NewFromUtf8(isolate, name); t->SetClassName(fn_name); - recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), t); + recv->PrototypeTemplate()->Set(fn_name, t); } #define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD