jeudi 27 février 2020

If Condition Simplification

I'm refactoring a code snippet in which I see the following condition that I wonder whether it's simplified.

data.RecordId != 0 || (data.RecordId == 0 && data.SerialNum == "0000")

Isn't data.RecordId == 0 || data.SerialNum == "0000" same of that?

If it is possible, how come? Could you detailed?

Aucun commentaire:

Enregistrer un commentaire