Skip to content

refactoring: remove Array.forEach used in place of Array.some/find - #204

Merged
bcoe merged 1 commit into
yargs:masterfrom
mleguen:refac/array-some
Oct 9, 2019
Merged

refactoring: remove Array.forEach used in place of Array.some/find#204
bcoe merged 1 commit into
yargs:masterfrom
mleguen:refac/array-some

Conversation

@mleguen

@mleguen mleguen commented Oct 2, 2019

Copy link
Copy Markdown
Member

Follow up of #202 (comment)

Replacing Array.forEach in checkAllAliases was not that straightforward, as this function was not really used for what its comment said it was, so I had to use Array.find instead of Array.some.

So I fixed the comment too.

@bcoe

bcoe commented Oct 7, 2019

Copy link
Copy Markdown
Member

@mleguen mind rebasing? this looks like a smart refactor.

@mleguen

mleguen commented Oct 7, 2019

Copy link
Copy Markdown
Member Author

Sure. Added to next wednesday's TODO.

No need to parse all the array when a single match is expected.
@bcoe
bcoe merged commit afcaecb into yargs:master Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants