enumer icon indicating copy to clipboard operation
enumer copied to clipboard

Optimize IsAXXX method

Open bokunodev opened this issue 3 years ago • 2 comments

we can optimize IsAXXX method to use switch statement instead of for loop. with this, we dont need stringBelongsMethodSet

bokunodev avatar Jan 06 '23 05:01 bokunodev

I'm interested in a PR if you have an idea.

dmarkham avatar Nov 07 '23 05:11 dmarkham

I believe, I've a prototype somewhere, unfortunately I'm currently nowhere near my computer.

manually unrolling the loop in the template and change it to switch case.I remember, i'm too lazy to fix the golden test. but I did test it and it actually perform wort with string enums also there is a proposal for loop unrolling on Go github account. so I'm not sure if it's worth to change anything, right now.

bokunodev avatar Nov 10 '23 05:11 bokunodev