Uh oh!
There was an error while loading. Please reload this page.
Conversation
There was a problem hiding this comment.
This change causes the else branch to be taken when n is equal to MAX_HWM. That seems less efficient then the if branch. and possibly a bug?
There was a problem hiding this comment.
OK, Thanks I've removed that modification.
Remove `(...)`, because this is a simple,sensitive expression.
richardlau
commented
Aug 22, 2018
This appears to be the sort of stylistic changes being discussed in #22351. |
ghost
commented
Aug 22, 2018
@richardlau:But you have to admit that this Please compare with them: So sometimes for those useless styles or styles aren't necessary (But not change to a style that will make bad effects on what the codes were). I think it worth changing to make tiny (but not much) refactors. Hope you can understand what I mean here. |
I am -0.5 on this. There might be a eslint rule for this and it would be fine for me with a rule if that does not result in to much churn. |
mscdex
commented
Aug 22, 2018
FWIW I generally prefer including conditional statements like this in parentheses when being assigned as a value as it makes it easier to read and that's why these parentheses currently exist there. |
I think it's time to have a disscussion on when to refactor(IMO): First, as what I said above, refactoring codes cannot make bad effects on what the codes were (including making performance lower than before, making hard to read / understand, or making unit tests too complicated to complete……ect). Anyway, any bad effects resulted by refactoring will be abandoned. And what @richardlau's closed example just belongs to this (because using Second, to make codes in style union. I mostly agree with what @BridgeAR said, but I have to say that even if when we all pass the eslint's checks, sometimes the stylish still will have useless or unnecessary things to be removed (Just like this fixture above). And the reason why we will do refactoring is that we should clean up codes to make them in union and look better, and obviously our Nodejs project belongs to the developers all over the world. Since we cannot control different people's options of code style, why don't we make them in union for obviously stylish problems? :) As for @mscdex's suggestions, this is still in discussion. If most of you think for a condition wrapped by Line 78 in 6acb550 (……)). |
ghost
commented
Aug 23, 2018
@addaleax:Yes I agree with you. And I think for those rules we should refactor codes:
Any other better ideas in details? It's interesting to share ideas and experience with all of you here :D |
addaleax
commented
Aug 27, 2018
CI: https://ci.nodejs.org/job/node-test-pull-request/16804/ I’d prefer to land this in the next few days rather than having it hang in limbo, given that there are 8 approving reviews at this point. |
Trott
commented
Sep 1, 2018
Resume build: https://ci.nodejs.org/job/node-test-pull-request/16920/ |
Trott
commented
Sep 3, 2018
ghost
commented
Sep 11, 2018
Maybe this can be merged? |
Trott
commented
Sep 11, 2018
addaleax
commented
Sep 12, 2018
tniessen
commented
Sep 12, 2018
CI was stopped, resuming again... https://ci.nodejs.org/job/node-test-pull-request/17149/ |
Trott
commented
Sep 13, 2018
Only red CI was arm-fanned. Re-run: https://ci.nodejs.org/job/node-test-commit-arm-fanned/3457/ |
addaleax
commented
Sep 13, 2018
Landed in 9c6f59e 😄 |
Remove `(...)`, because this is a simple,sensitive expression. PR-URL: #22455 Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
ghost
commented
Sep 13, 2018
Thanks all for your help! |
Remove `(...)`, because this is a simple,sensitive expression. PR-URL: #22455 Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Remove `(...)`, because this is a simple,sensitive expression. PR-URL: #22455 Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Remove `(...)`, because this is a simple,sensitive expression. PR-URL: #22455 Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Remove
(...), because this is a simple,sensitive expression.make -j4 test(UNIX), orvcbuild test(Windows) passes