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

Editorial: Simplify the algorithms for Array and TypedArray constructors #3544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gibson042
Copy link
Contributor

@gibson042 gibson042 commented Feb 26, 2025

Remove some unnecessary condition nesting and a trivial assertion. The small scope of the changes is most obvious while ignoring whitespace.

@michaelficarra
Copy link
Member

I'm fine removing the assertion, but the elses I am less sure about. The early returns are technically the same, but I think the else if/else branches are easier to scan.

@gibson042 gibson042 force-pushed the 2025-02-simplify-array-construction branch from d367283 to a445b8c Compare February 27, 2025 17:28
@gibson042
Copy link
Contributor Author

FWIW, I feel more strongly about the TypedArray changes than the Array ones, because for me the excessive indentation (not to mention vertical expansion) makes it hard to follow.

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.

2 participants