Skip to content

Refactor src/lib/libopenal.js. NFC - #27425

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:openal_refactor
Open

Refactor src/lib/libopenal.js. NFC#27425
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:openal_refactor

Conversation

@sbc100

@sbc100 sbc100 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator
  • Use for .. of in a few more places.
  • Remove code duplication in setSourceParam(AL_BUFFER). The if condition here had a lot of the same code on each branch.

@sbc100
sbc100 requested a review from kripken July 28, 2026 04:10
@sbc100
sbc100 force-pushed the openal_refactor branch from da26ca6 to 493e2ed Compare July 28, 2026 16:24
@sbc100
sbc100 requested a review from brendandahl July 28, 2026 16:25
Comment thread src/lib/libopenal.js Outdated
@sbc100
sbc100 force-pushed the openal_refactor branch from 493e2ed to 85f4926 Compare July 28, 2026 21:06
Comment thread src/lib/libopenal.js Outdated

for (var i in ctx.sources) {
AL.scheduleSourceAudio(ctx.sources[i]);
for (var src of Object.values(ctx.sources)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The same is true here, I think? Object.values allocates a new output array.

- Use `for .. of` in a few more places.
- Remove duplication in setSourceParam(AL_BUFFER)
@sbc100
sbc100 force-pushed the openal_refactor branch from 85f4926 to f36fb6b Compare July 28, 2026 22:23
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