ProjectIgnis / CardScripts

Project Ignis card script libraries and canonical card scripts for EDOPro. Send bug reports through Discord only!
86 stars 60 forks source link

Small improvement: Simplify redundant logic regarding the ternary 'or' #1064

Closed 0x4261756D closed 1 year ago

0x4261756D commented 1 year ago

There were many cases of the pattern x and x or y. Due to operator precedence this is evaluated as (x and x) or y. Since x and x is equivalent to x itself this can be simplified, improving clarity and sometimes removing unnecessary function calls. (don't know if Lua would optimize them anyways though)