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

Don't modify input attributes #1058

Merged
merged 2 commits into from Apr 12, 2019
Merged

Don't modify input attributes #1058

merged 2 commits into from Apr 12, 2019

Conversation

tsherif
Copy link
Contributor

@tsherif tsherif commented Apr 12, 2019

This was interfering with reuse of deck mesh attributes.

@coveralls
Copy link

coveralls commented Apr 12, 2019

Coverage Status

Coverage decreased (-0.008%) to 44.917% when pulling b70bd88 on mutating-attributes into 2f7504c on master.

@tsherif tsherif requested a review from 1chandu April 12, 2019 21:10
@@ -92,7 +92,6 @@ export default class Geometry {
if (attributeName === 'indices') {
assert(!this.indices);
delete attribute.isIndexed;
delete attributes[attributeName];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is deleting this going to change the model behavior (creating an extra buffer)? Can we just make a copy of the attributes object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this was just modifying the input object. Buffers are created based on this.attributes.

@@ -92,7 +92,6 @@ export default class Geometry {
if (attributeName === 'indices') {
assert(!this.indices);
delete attribute.isIndexed;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is also mutating the input.

@tsherif tsherif merged commit e9789da into master Apr 12, 2019
@tsherif tsherif deleted the mutating-attributes branch April 18, 2019 17:57
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

3 participants