From 6ae6469d4aa29065b39ef40f16599c2046205a97 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 2 Aug 2017 02:19:27 +0200 Subject: [PATCH] src: use existing strings over creating new ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a very very minor change. PR-URL: https://github.com/nodejs/node/pull/14587 Reviewed-By: James M Snell Reviewed-By: Timothy Gu Reviewed-By: Brian White Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen --- src/tcp_wrap.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 4967b407145c1c..4bee4b97097f40 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -77,13 +77,9 @@ void TCPWrap::Initialize(Local 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);