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

Replace the array_merge with spread array operator #43

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

peter279k
Copy link
Contributor

Changed log

  • According to the reference, it's great to use the spread array operator to replace the array_merge function.
  • There're two reasons about using the spread array operator:
    • Spread operator should have a better performance than array_merge and compile time optimization can be performant for constant arrays.
    • array_merge only supports array, while the spread operator also supports objects implementing Traversable.

Copy link
Owner

@michaelpetri michaelpetri left a comment

Choose a reason for hiding this comment

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

Thanks for the addition

@michaelpetri michaelpetri self-assigned this Sep 20, 2023
@michaelpetri michaelpetri added the enhancement New feature or request label Sep 20, 2023
@michaelpetri michaelpetri merged commit 2abc4a0 into michaelpetri:main Sep 25, 2023
@peter279k peter279k deleted the optimize_array_merge branch September 25, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants