-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
tools: dedupe property access in doc/type-parser #20387
tools: dedupe property access in doc/type-parser #20387
Conversation
Please, add 👍 here to approve fast-tracking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM while I suggest to change the typeUrl
default to undefined.
@vsemozhetbyt sorry for not being clear with my comment: if you just do: |
There is no need to get this property twice in this rather hot spot: if there is no such key, the `typeUrl` will be `undefined`, which suffices for the boolean check in the next line. For consistency, `undefined` can also be made the default value.
@BridgeAR I've updated the code and commit message. @BridgeAR, @tniessen, @trivikr Is this still OK for you? CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/622/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LG
Yep. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Landed in 1c530e8 |
There is no need to get this property twice in this rather hot spot: if there is no such key, the `typeUrl` will be `undefined`, which suffices for the boolean check in the next line. For consistency, `undefined` can also be made the default value. PR-URL: #20387 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
There is no need to get this property twice in this rather hot spot: if there is no such key, the `typeUrl` will be `undefined`, which suffices for the boolean check in the next line. For consistency, `undefined` can also be made the default value. PR-URL: #20387 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesThere is no need to get this property twice in this rather hot spot: if there is no such key, the
typeUrl
will beundefined
, which suffices for the boolean check in the next line.For consistency,
undefined
can also be made the default value.