#yes. You can eliminate the first array

1 messages · Page 1 of 1 (latest)

safe apex
#

That would involve pulling those definitions out from within the method, correct? Basically, what I want is for each line of the switch statement to contain the relevant potential outcomes (which are constant)

swift reef
#

yes. Are you calling this in an update loop? I would leave this as an optimization for later personally

safe apex
#

yeah, exactly

#

Hmm, on that note, how do people typically indicate that something is to be optimized later? Do you just throw around a bunch of TODOs?

swift reef
#

that's one way, but I would be using the profiler and using it to guide me to find the things spewing garbage or taking too long

safe apex
#

okok, thanks

safe apex
#

Actually, I sat on this more, and I think I can convert my switch statement to a dictionary. The only problem is - are there any dictionary implementations that support pattern matching? e.g.

dict[(A, A)] = 1;
dict[(A, B)] = 1;
dict[(B, _)] = -1;
floral hull