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

Reduce unnecessary usage of Array.prototype.concat() #15059

Merged
merged 1 commit into from
Jun 19, 2022

Commits on Jun 19, 2022

  1. Reduce unnecessary usage of Array.prototype.concat()

    There are obviously cases where using `concat` makes perfect sense, since that method doesn't change any of the existing Arrays; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat
    
    However, in a few cases throughout the code-base that's not an issue and using `concat` only leads to unnecessary intermediate allocations. With modern JavaScript we can thus replace those with a combination of `push` and spread-syntax, which wasn't originally possible when the code was written.
    Snuffleupagus committed Jun 19, 2022
    Configuration menu
    Copy the full SHA
    c21f4fa View commit details
    Browse the repository at this point in the history