Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jun 13, 2023

No description provided.

@sbc100 sbc100 requested a review from kripken June 13, 2023 22:40
@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 13, 2023

@jameshu15869, who as been working on some of this code recently.

@jameshu15869
Copy link
Contributor

Just to check, the simplification is removing the return statement before withStackSave() because it's a one line function that JS knows to return without using the return keyword and curly braces, right? If so, I'll make sure to keep this in mind going forward.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 14, 2023

Just to check, the simplification is removing the return statement before withStackSave() because it's a one line function that JS knows to return without using the return keyword and curly braces, right? If so, I'll make sure to keep this in mind going forward.

Yes. When using the arrow function syntax ((...) => ...) and you don't use curly braces, then whatever the single statement evaluates too is treated as the function's return value.

@sbc100 sbc100 enabled auto-merge (squash) June 14, 2023 00:04
@sbc100 sbc100 merged commit f3bba6e into main Jun 14, 2023
@sbc100 sbc100 deleted the simplify_withStackSave branch June 14, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants