Browse Source

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 <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
XadillaX 8 years ago
committed by Refael Ackermann
parent
commit
b5d8d7c6f9
  1. 2
      src/node.h

2
src/node.h

@ -293,7 +293,7 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local<v8::FunctionTemplate> recv,
v8::FunctionTemplate::New(isolate, callback, v8::Local<v8::Value>(), s);
v8::Local<v8::String> 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

Loading…
Cancel
Save