Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: don't create Undefined if not needed #20573

Closed

Conversation

danbev
Copy link
Contributor

@danbev danbev commented May 7, 2018

This commit moves the creation of argv and only creates an undefined
value if the passed in status was not 0.

The variable name client_handle was already used in this function but
I've change that usage so that this variable name matches the
onconnection callback functions parameter name clientHandle.

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

This commit moves the creation of argv and only creates an undefined
value if the passed in status was not 0.

The variable name client_handle was already used in this function but
I've change that usage so that this variable name matches the
onconnection callback functions parameter name clientHandle.
@nodejs-github-bot nodejs-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 May 7, 2018
@danbev
Copy link
Contributor Author

danbev commented May 7, 2018

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

I guess this is fine but it's not as if v8::Undefined() is super expensive. It compiles to an indexed load relative to the isolate pointer.

@danbev
Copy link
Contributor Author

danbev commented May 9, 2018

Landed in 590769b.

@danbev danbev closed this May 9, 2018
@danbev danbev deleted the src_connection_wrap_onconnection branch May 9, 2018 08:22
danbev added a commit that referenced this pull request May 9, 2018
This commit moves the creation of argv and only creates an undefined
value if the passed in status was not 0.

The variable name client_handle was already used in this function but
I've change that usage so that this variable name matches the
onconnection callback functions parameter name clientHandle.

PR-URL: #20573
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this pull request May 12, 2018
This commit moves the creation of argv and only creates an undefined
value if the passed in status was not 0.

The variable name client_handle was already used in this function but
I've change that usage so that this variable name matches the
onconnection callback functions parameter name clientHandle.

PR-URL: #20573
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@addaleax addaleax mentioned this pull request May 14, 2018
Sign up for free to 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++. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants