-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
src: remove duplicated code in GenerateSingleExecutableBlob()
#49119
Conversation
Review requested:
|
src/node_sea.cc
Outdated
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; | ||
} |
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.
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.
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.
@deokjinkim
Thank you for your good comments.
You are right. It seems like a better idea. I reflected what you said.
4026cf4
to
0f27c01
Compare
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, thanks for catching this
Landed in 6476c99 |
PR-URL: #49119 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
PR-URL: nodejs#49119 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
PR-URL: nodejs#49119 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
PR-URL: #49119 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
PR-URL: #49119 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
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