>> Swapping the comparison order here seems a bit inconsistent to me. There are >> lots of others around (e.g. "len == 0" in the patch context below). Why is >> this one so special? >> >> I think that another developer even got told off once for these kinds of >> comparisons. >> >> I hope the Clang warning is only about the parentheses. > > I agree with Georg: "if ('u' == typecode)" is not well readable, > since you usually put the variable part on the left and the constant > part on the right of an equal comparison. > > If clang warns about this, clang needs to be fixed, not our > C code :-) > +1 Placing the constant first in a comparison is a fundamental style issue. Personally I also don't like doing that, but whatever way is chosen must be consistent. It's definitely wrong to change this in a single place. We have PEP-7 for these things! AFAIK, Clang doesn't produce a warning for this, at least without special static-analysis warning levels. Eli
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4