summaryrefslogtreecommitdiff
path: root/src/tcp_wrap.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-08-02 02:19:27 +0200
committerMyles Borins <mylesborins@google.com>2017-09-05 12:50:01 -0400
commitfe6735cc19c64b38ba7c2b094a3dd972cfa4b163 (patch)
tree37f670b88c83e6f51a886b658dcdb9b65b2458ce /src/tcp_wrap.cc
parent2ce80d97e94baba7d7dee8d2ede9b4b5c88bd02b (diff)
downloadnode-new-fe6735cc19c64b38ba7c2b094a3dd972cfa4b163.tar.gz
src: use existing strings over creating new ones
This is a very very minor change. PR-URL: https://github.com/nodejs/node/pull/14587 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r--src/tcp_wrap.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index b2617a5695..5150972591 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -55,13 +55,9 @@ void TCPWrap::Initialize(Local<Object> target,
// Init properties
t->InstanceTemplate()->Set(String::NewFromUtf8(env->isolate(), "reading"),
Boolean::New(env->isolate(), false));
- t->InstanceTemplate()->Set(String::NewFromUtf8(env->isolate(), "owner"),
- Null(env->isolate()));
- t->InstanceTemplate()->Set(String::NewFromUtf8(env->isolate(), "onread"),
- Null(env->isolate()));
- t->InstanceTemplate()->Set(String::NewFromUtf8(env->isolate(),
- "onconnection"),
- Null(env->isolate()));
+ t->InstanceTemplate()->Set(env->owner_string(), Null(env->isolate()));
+ t->InstanceTemplate()->Set(env->onread_string(), Null(env->isolate()));
+ t->InstanceTemplate()->Set(env->onconnection_string(), Null(env->isolate()));
env->SetProtoMethod(t, "close", HandleWrap::Close);