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

Use AFRAME.utils.split in getComponentPropertyPath fixing caching behaviour #5467

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Feb 15, 2024

Description:
Noticed that that AFRAME.utils.entity.getComponentPropertyPath didn't properly use its cache. It constructed a cache and populated it, but never checked if strings were already cached. Meaning it would always recompute (= split), place in cache and then immediately return that value from the cache.

This PR simply replaces the broken caching mechanism with AFRAME.utils.split, since the split utility also uses a cache internally. Added benefit is that the cache is now also shared between the two.

Changes proposed:

  • Fix property path caching by using AFRAME.utils.split which internally caches

@dmarcos
Copy link
Member

dmarcos commented Feb 17, 2024

Thanks!

@dmarcos dmarcos merged commit 32f5370 into aframevr:master Feb 17, 2024
1 check passed
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