Skip to content
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

src: remove duplicated code in GenerateSingleExecutableBlob() #49119

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

pluris
Copy link
Contributor

@pluris pluris commented Aug 12, 2023

The removed optional_code_cache variable is already declared with the same name in the line below.
In my opinion, it was judged to be unnecessary redundant code and was removed.

node/src/node_sea.cc

Lines 489 to 494 in 3224527

std::optional<std::string> optional_code_cache =
GenerateCodeCache(config.main_path, main_script);
if (!optional_code_cache.has_value()) {
FPrintF(stderr, "Cannot generate V8 code cache\n");
return ExitCode::kGenericUserError;
}

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/single-executable

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications labels Aug 12, 2023
src/node_sea.cc Outdated
Comment on lines 499 to 504
std::optional<std::string> optional_code_cache =
GenerateCodeCache(config.main_path, main_script);
if (!optional_code_cache.has_value()) {
FPrintF(stderr, "Cannot generate V8 code cache\n");
return ExitCode::kGenericUserError;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, these lines(499-504) are only needed if flag for code cache is enabled. So how about removing above declaration(489-494) instead of this? Plus, declaration of code_cache variable(497) can be moved into if statement.

@RaisinTen PTAL when you are available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deokjinkim
Thank you for your good comments.
You are right. It seems like a better idea. I reflected what you said.

@pluris pluris requested a review from deokjinkim August 13, 2023 06:18
@pluris pluris force-pushed the fix/remove_unnessary_code branch from 4026cf4 to 0f27c01 Compare August 13, 2023 06:19
@deokjinkim deokjinkim added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 13, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 13, 2023
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@RaisinTen RaisinTen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for catching this

@RaisinTen RaisinTen added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 14, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 14, 2023
@nodejs-github-bot nodejs-github-bot merged commit 6476c99 into nodejs:main Aug 14, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 6476c99

@pluris pluris deleted the fix/remove_unnessary_code branch August 15, 2023 05:18
RafaelGSS pushed a commit that referenced this pull request Aug 15, 2023
PR-URL: #49119
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Aug 15, 2023
RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Aug 15, 2023
PR-URL: nodejs#49119
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
rluvaton pushed a commit to rluvaton/node that referenced this pull request Aug 15, 2023
PR-URL: nodejs#49119
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 16, 2023
PR-URL: #49119
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 17, 2023
PR-URL: #49119
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants