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

Constant comparison #276

Open
b4yuan opened this issue Aug 23, 2023 · 1 comment
Open

Constant comparison #276

b4yuan opened this issue Aug 23, 2023 · 1 comment

Comments

@b4yuan
Copy link
Contributor

b4yuan commented Aug 23, 2023

if (width > 10000 || length > 10000 || precision > 10000) {

length should always <= 320, so the length > 10000 comparison will always evaluate to false.

@msteveb
Copy link
Owner

msteveb commented Aug 23, 2023

Thanks for the report. I didn't write this code and I haven't looked through it carefully. You are probably right, but what if the code is modified in the future and length could be unreasonably long? I'm not sure if removing a single always-false comparison is worth it.

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

2 participants