GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — repl: small refactoring by BridgeAR · Pull Request #17919 · nodejs/node Conversation
Member
Just a minor refactoring to make the code more pleasant. Checklist
Affected core subsystem(s)repl
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
jasnell
approved these changes
tniessen
approved these changes
lpinca
approved these changes
starkwang
approved these changes
cjihrig
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just remove this?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It probably doesn't make a difference, but this has the potential to be a behavior change if only one of
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, do you want me to change it to the way it was before? I personally do not feel like this is ever going to matter.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
XadillaX
approved these changes
maclover7
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM except for @cjihrig's 2 comments.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
vikkyconer
suggested changes
|
| return expr + '.' + member; | ||
| })); | ||
| completionGroups.push( | ||
| memberGroups[i].map((member) => expr + '.' + member)); |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
const foo = memberGroups.reduce(( acc, memberGroup ) => { acc.push(memberGroup.map((member) => `${ expr }.${ member }`)); return acc; }, []); completionGroups.concat(foo);
Don't mind the name foo as could not think of some descent name but this will make the code immutable. Although we are mutating completionGroups array but in next change we can convert it also to immutability
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That is not necessary out of my perspective. I personally feel the current code is more expressive than using reduce.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: nodejs#17919 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Lance Ball <[email protected]>
PR-URL: nodejs#17919 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Lance Ball <[email protected]>
|
this does not land cleanly on v9.x, could you please backport? as an aside @BridgeAR it appears you are listing the commits in the reverse order they landed... which can make things confusing when landing on release branches. In future could you post the commits in chronological order, or alternatively using the range syntax [headbefore]...[headafter] |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Backported in #19244 (about the order: I fixed that a while ago in my script. It is always in chronological order again). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: nodejs#17919 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Lance Ball <[email protected]>
PR-URL: nodejs#17919 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Lance Ball <[email protected]>
Backport-PR-URL: #19244 PR-URL: #17919 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Lance Ball <[email protected]>
Backport-PR-URL: #19244 PR-URL: #17919 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Lance Ball <[email protected]>
|
Backport requested for 8.x in #19244 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.