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

Update mesh.js #5663

Closed

Conversation

chrissterling
Copy link

Fix bug in getIndices which incorrectly modifies an array to have an array in the first element instead of setting the array to the numbers.

Fixes #

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

Fix bug in getIndices which incorrectly modifies an array to have an array in the first element instead of setting the array to the numbers.
@@ -723,7 +723,7 @@ class Mesh extends RefCountedObject {
} else {
// destination data is array
indices.length = 0;
indices.push(streamIndices);
indices.push(...streamIndices);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, but lets avoid using spread operator here on these potentially larger arrays due to nodejs/node#16870
(We've had an experience in other code with this)

Copy link
Collaborator

@kungfooman kungfooman Sep 22, 2023

Choose a reason for hiding this comment

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

Looks like a good-old for-loop would handle both cases equally here (untested assumption)

Copy link
Contributor

Choose a reason for hiding this comment

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

yep

Copy link
Contributor

Choose a reason for hiding this comment

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

@chrissterling - would you have time to do this change please?

@LeXXik LeXXik mentioned this pull request Sep 28, 2023
@mvaligursky
Copy link
Contributor

Thanks for finding the issue and the fix, that was really helpful, we've merged slightly modified fix now, so I'm closing this one.

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.

3 participants