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

Cache getScaleForId() calls in the line controller #6250

Merged
merged 1 commit into from May 8, 2019

Conversation

benmccann
Copy link
Contributor

Minor performance improvement. Saves two calls to getMeta and three to getScaleForId for each data point

Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

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

Good little optimization.
Couple of bytes could be saved more, but those might be worth wasting for readability. I'm ok either way.

src/controllers/controller.line.js Show resolved Hide resolved
@simonbrunel simonbrunel added this to the Version 2.9 milestone May 8, 2019
@simonbrunel simonbrunel merged commit f093c36 into chartjs:master May 8, 2019
@simonbrunel simonbrunel changed the title Cache scales Cache getScaleForId() calls in the line controller May 8, 2019
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants