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 .concat with push and/or spread operator. NFC #22067

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

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jun 6, 2024

No description provided.

@sbc100 sbc100 requested a review from kripken June 6, 2024 14:34
@sbc100 sbc100 changed the title Use .push over .concat in modules.mjs. NFC Replace .concat with push and/or spread operator. NFC Jun 6, 2024
@@ -842,7 +842,7 @@ var LibraryOpenAL = {
case {{{ cDefs.AL_VELOCITY }}}:
return AL.currentCtx.listener.velocity;
case {{{ cDefs.AL_ORIENTATION }}}:
return AL.currentCtx.listener.direction.concat(AL.currentCtx.listener.up);
return AL.currentCtx.listener.direction + AL.currentCtx.listener.up;
Copy link
Member

Choose a reason for hiding this comment

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

These are arrays so this changes the result, doesn't it? E.g.

> [0, 0, 0] + [1, 2, 3]
'0,0,01,2,3'
> [0, 0, 0].concat([1, 2, 3])
[ 0, 0, 0, 1, 2, 3 ]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oops, reverted.

@@ -1 +1 @@
4475
4553
Copy link
Member

Choose a reason for hiding this comment

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

Odd that this increases code size?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting yes... maybe I'll split out the internal stuff and land that on its own.

sbc100 added a commit to sbc100/emscripten that referenced this pull request Jun 11, 2024
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jun 11, 2024
sbc100 added a commit to sbc100/emscripten that referenced this pull request Jun 11, 2024
sbc100 added a commit that referenced this pull request Jun 11, 2024
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.

None yet

2 participants