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

lib: update indentation of ternaries #14247

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Jul 15, 2017

In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.

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

lib tools

@Trott Trott added lib / src Issues and PRs related to general changes in the lib or src directory. tools Issues and PRs related to the tools directory. labels Jul 15, 2017
@nodejs-github-bot nodejs-github-bot added events Issues and PRs related to the events subsystem / EventEmitter. net Issues and PRs related to the net subsystem. url Issues and PRs related to the legacy built-in url module. labels Jul 15, 2017
@addaleax
Copy link
Member

There’s a typo in the commit message ;)

lib/url.js Outdated
result.host.split('@') : false;
const authInHost =
result.host && result.host.indexOf('@') > 0 ?
result.host.split('@') : false;
Copy link
Member

Choose a reason for hiding this comment

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

This doesn’t need to be a ternary anyway, right? Just result.host && result.host.indexOf('@') > 0 && result.host.split('@') works as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea! I don't think there's much of a chance this is being done as a ternary because it's more performant than the alternative approach you're suggesting here. But that's usually behind my reluctance to alter anything other than whitespace in these things. :-D

@Trott
Copy link
Member Author

Trott commented Jul 15, 2017

There’s a typo in the commit message ;)

Fixed. Thanks!

@Trott Trott changed the title lib: update indentaion of ternaries lib: update indentation of ternaries Jul 15, 2017
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.
@Trott
Copy link
Member Author

Trott commented Jul 15, 2017

Trott added a commit to Trott/io.js that referenced this pull request Jul 18, 2017
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.

PR-URL: nodejs#14247
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Trott
Copy link
Member Author

Trott commented Jul 18, 2017

Landed in d14c132

@Trott Trott closed this Jul 18, 2017
@addaleax addaleax mentioned this pull request Jul 18, 2017
addaleax pushed a commit that referenced this pull request Jul 18, 2017
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.

PR-URL: #14247
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.

PR-URL: #14247
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Trott added a commit to Trott/io.js that referenced this pull request Aug 15, 2017
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.

PR-URL: nodejs#14247
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.

Backport-PR-URL: #14835
PR-URL: #14247
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Aug 16, 2017
MylesBorins pushed a commit that referenced this pull request Sep 5, 2017
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.

Backport-PR-URL: #14835
PR-URL: #14247
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Trott Trott deleted the indent-ternaries-in-lib branch January 13, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events Issues and PRs related to the events subsystem / EventEmitter. lib / src Issues and PRs related to general changes in the lib or src directory. net Issues and PRs related to the net subsystem. tools Issues and PRs related to the tools directory. url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants