vendredi 27 mars 2020

Can I make this 'if' condition shorter?

I have this condition:

if (pt.left == anything || pt.left == null || pt.left == borders.left || borders.left == anything)

can I make it shorter? I'm thinking about something like this:

if(pt.left == (anything || null || borders.left) || borders.left == anything)

Is there any way to do it?

Aucun commentaire:

Enregistrer un commentaire