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 <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
addaleax committed Aug 7, 2017
1 parent e658d32 commit efea3fc
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 @@ -77,13 +77,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, "getAsyncId", AsyncWrap::GetAsyncId);
env->SetProtoMethod(t, "asyncReset", AsyncWrap::AsyncReset);
Expand Down

0 comments on commit efea3fc

Please sign in to comment.