I did figure out using a waitframe if it looked like I'd drop straight through a loops.
Generally I use switches if the context will require more than 3 if/else/whatever. Is there a certain point where switches will not show any improvement or is it just always better to use?
Don't beat yourself up. I forget far more than just brackets every day.....
Generally, in other languages, it is more efficient to interpret a case statement, or emit a jump table for one, than evaluate or emit code for a corresponding set of 'if' constructs, virtually regardless of the number of conditions since a switch only has one condition to evaluate. Simply put, I cant imagine a scenario where multiple comparisons against a constant wouldn't be less expensive than a full blown eval of an expression multiple times.
I do not know how Morpheus specifically handles this, but I'd be very surprised if it was different. My statement should not be taken as authoritative but it is likely to be true Someday when I find some 'roundtuits', or someone else familiar with it, will look.
Tode
Last edited by Todesengel; November 16th, 2019 at 11:40 AM.
Reason: 4:20
Maybe I can do some test case comparisons for speed.
I tend to use multiple comparatives or ranges within my IF statements which tend to not translate well into a switch. But hey, where there is a will there is a way!