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

Code quality remarks #2

Open
4 of 11 tasks
jpcima opened this issue Aug 3, 2021 · 0 comments
Open
4 of 11 tasks

Code quality remarks #2

jpcima opened this issue Aug 3, 2021 · 0 comments

Comments

@jpcima
Copy link
Contributor

jpcima commented Aug 3, 2021

Grain:

GrainPlayer:

fabricDSP:

Mathf:

  • lerp can be rewritten with one less operation
    a * (1.0 - f) + (b * f); replaced with a + f * (b - a);

General:

  • initialize scalar instance variables, to the relevant default or {}, preferably in the declaration rather than constructor (example float sides {};)

NanoVG:

  • close the path first, then draw it.
    eg. following code is nonsense, but most likely fill() closes the path by itself, making the next one redundant
    fill(); closePath();
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

No branches or pull requests

1 participant