diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-03-19 20:18:22 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-03-26 16:48:56 +0300 |
commit | 3018441304697fe801fc81385229b5a78a62cc54 (patch) | |
tree | 22d9083a71267574f34a2913a59fe13c6bc564a7 /src/tty_wrap.cc | |
parent | 53ebd3311d4e0ef184a062b2f657ac69dc8a7acf (diff) |
src: store onread callback in internal field
This gives a slight performance improvement. At 2000 runs:
confidence improvement accuracy (*) (**) (***)
net/net-c2s.js dur=5 type='buf' len=64 *** 0.54 % ±0.16% ±0.21% ±0.27%
PR-URL: https://github.com/nodejs/node/pull/26837
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index 423f53c014d..405b70343f7 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -52,7 +52,7 @@ void TTYWrap::Initialize(Local<Object> target, Local<FunctionTemplate> t = env->NewFunctionTemplate(New); t->SetClassName(ttyString); t->InstanceTemplate() - ->SetInternalFieldCount(StreamBase::kStreamBaseField + 1); + ->SetInternalFieldCount(StreamBase::kStreamBaseFieldCount); t->Inherit(LibuvStreamWrap::GetConstructorTemplate(env)); env->SetProtoMethodNoSideEffect(t, "getWindowSize", TTYWrap::GetWindowSize); |