How to make my function more efficient?

Alright yeah that’s true researching further into it again

But yeah my point still stands with reducing the number of indexing and logic or statements if you really want to go with this micro-optimization.

These questions are interesting but I always end up regretting researching it, always like 1 ms difference for a lot of work.