Skip to content

src: use existing strings over creating new ones - #14587

Closed
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:tcp-existing-strings
Closed

src: use existing strings over creating new ones#14587
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:tcp-existing-strings

Conversation

@addaleax

Copy link
Copy Markdown
Member

This is a very very minor change.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src/tcp_wrap.cc

This is a very very minor change.
@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. net Issues and PRs related to the net subsystem. labels Aug 2, 2017
@mscdex

Copy link
Copy Markdown
Contributor

LGTM if CI is ok with it: https://ci.nodejs.org/job/node-test-pull-request/9446/

@tniessen

Copy link
Copy Markdown
Member

CI seems to hiccup, new attempt: https://ci.nodejs.org/job/node-test-pull-request/9449/

Comment threadsrc/tcp_wrap.cc
@@ -77,13 +77,9 @@ void TCPWrap::Initialize(Local<Object> target,
// Init properties
t->InstanceTemplate()->Set(String::NewFromUtf8(env->isolate(), "reading"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to add "reading" to env.h as well? Are we trying to keep that list small?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s there for strings that would otherwise be re-created multiple times in the lifetime of a Node instance, but this appears to be the only usage of it in src/.

@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in efea3fc, 3f98b0f

@addaleaxaddaleax closed this Aug 7, 2017
@addaleax
addaleax deleted the tcp-existing-strings branch August 7, 2017 12:57
addaleax added a commit that referenced this pull request Aug 7, 2017
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>
addaleax pushed a commit that referenced this pull request Aug 7, 2017
PR-URL: #14587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax added a commit that referenced this pull request Aug 7, 2017
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>
addaleax pushed a commit that referenced this pull request Aug 7, 2017
PR-URL: #14587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins

Copy link
Copy Markdown
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
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>
@MylesBorinsMylesBorins mentioned this pull request Aug 16, 2017
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
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>
MylesBorins pushed a commit that referenced this pull request Sep 3, 2017
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>
MylesBorins pushed a commit that referenced this pull request Sep 5, 2017
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>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.netIssues and PRs related to the net subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@addaleax@mscdex@tniessen@MylesBorins@jasnell@TimothyGu@cjihrig@nodejs-github-bot