Skip to content

Commit

Permalink
src: use existing strings over creating new ones
Browse files Browse the repository at this point in the history
This is a very very minor change.

PR-URL: #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>
  • Loading branch information
addaleax authored and MylesBorins committed Aug 16, 2017
1 parent 014a9bd commit 071018e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/tcp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 071018e

Please sign in to comment.