-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 add polyline to update list twice #7155
Conversation
Thanks for the pull request @hpinkos!
Reviewers, don't forget to make sure that:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
I'm pretty certain this exact code (or something like it) used to use indexOf and we changed it because it's a major performance killer. You are basically doing a linear search for every polyline being updated. What is the root problem here, we are essentially updating the line twice and that leads to an error? Could we avoid the indexOf by using a dirty flag and simply not doing the second update if it's already been called? |
Good call @mramato, I didn't realize polyline had a dirty flag. |
I didn't either, glad it was that easy 😄 That being said, it would it make more sense to add this check in Polyline.js itself, that way it avoids calling |
@mramato no, I don't think that will work because the polyline might have multiple properties changed and the |
Good call. That makes sense. Should we add a unit test for this? @bagnell can you review and merge? Thanks. |
Looks good to me. Can you add a test @hpinkos? |
@bagnell ready |
Fixes #7153