jimtcl icon indicating copy to clipboard operation
jimtcl copied to clipboard

Constant comparison

Open b4yuan opened this issue 2 years ago • 1 comments
trafficstars

https://github.com/msteveb/jimtcl/blob/9784dcf88e8f0204550b4218f1c77bfa510a497b/jim-format.c#L404

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

b4yuan avatar Aug 23 '23 17:08 b4yuan

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.

msteveb avatar Aug 23 '23 23:08 msteveb