| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
|
While it technically reduces the number of statements, I don't really see how this improves the code or its readability. |
Sorry, something went wrong.
I see the concern, but grouping returning values in a single case reduces redundancy and improves code efficiency, making it easier to maintain and read. Even though it's a minor repetition, this constitutes a code duplication and violates the DRY (Don't Repeat Yourself) principle. As a result, you can already observe instances of the same operation being performed in various parts of the project. Despite the small magnitude of the issue, I still strive to contribute to the project in any way possible. https://github.com/nodejs/node/blob/main/lib/internal/crypto/cfrg.js#L49 And more... |
Sorry, something went wrong.
|
If this is going to fallthrough would you mind moving the returns on newlines to actually help readability? |
Sorry, something went wrong.
Thank you for your response, I have rearranged the code as you suggested. |
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think this improves much but it also doesn't stand to hurt anything.
Sorry, something went wrong.
Failed to start CI- Validating Jenkins credentials ✘ Jenkins credentials invalidhttps://github.com/nodejs/node/actions/runs/5775909236 |
Sorry, something went wrong.
|
Need to wait until https://nodejs.org/en/blog/vulnerability/august-2023-security-releases is through to start CI and let this progress. |
Sorry, something went wrong.
|
It is a cosmetic change. I'm approving only because there is another approval. With two approvals we can land it faster without waiting one week. |
Sorry, something went wrong.
I am not sure if it really improves code efficiency, and as @panva said, even if it does, efficiency really doesn't matter much here. I don't think this is an improvement because intuitively this is a one-to-one mapping from algorithms to block sizes. One line per algorithm, the name on the left and the corresponding value on the right. Easily readable and mathematically concise. Grouping algorithms like this makes no sense. The fact that SHA-1 and SHA-256 have the same internal block size is purely coincidental. The algorithms are vastly different. If we keep adding algorithms to the list, this change will effectively demand ordering algorithms by their block size. For example, the SHA-3 bitrates (i.e., block sizes) fall both below and above that of SHA-512, so I guess we'd have to mix SHA-2 and SHA-3 in this list? Anyway, I won't object, but I don't think these changes help. |
Sorry, something went wrong.
Same here. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
FWIW, the commit message still doesn't adhere to the commit message guidelines since it doesn't begin with an imperative verb after the prefix. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #49030 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #49030 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: nodejs#49030 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
| Back | FazBrowse Home | New Git URL |
I defined the same returning values within a switch-case under a single case.