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

Remove WaveDrawable completely. #1747

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

0x7FFF
Copy link

@0x7FFF 0x7FFF commented Mar 6, 2023

WaveDrawable is unused as a class, so there's no need for it. Constants from it are replaced with actual numbers, no need for useless math every time.

Replace constants that were pulled out from WaveDrawable.
@SpangleLabs
Copy link

It is generally useful to have constants defined in one place, such that they can be edited once and changed everywhere at the same time.
Using "actual numbers" around the place like you have done is often called "magic numbers" because it is suddenly unclear what the numbers mean, or where they came from.
The java compiler will likely do the math once, and use that value, as it knows at compile time that these constants are constants, and won't need recomputing every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants