ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.86k stars 295 forks source link

SAST: coverity scan : Operands don't affect result #374

Closed raghvendra-dixit closed 1 year ago

raghvendra-dixit commented 2 years ago

As part of coverity scan , following is observed in Details: The expression's value does not depend on the operands; often, this represents an inadvertent logic error. In github.​com/ugorji/go/codec.​mpdesc(byte, string): An operation with non-constant operands that computes a result with constant value.

image
ugorji commented 1 year ago

Leave as is for code cleanliness reasons. At worst, it's redundant but removing this check causes a change to the constants to introduce a bug.