I doubt you could measure a performance difference...
# language-proposals
l
I doubt you could measure a performance difference even if you tried. The amount of code is obviously a matter of opinion.. but really.. how many enum types are there in Android that you actually use? 10 ? 100 ? 1 reply @spand If you replace all the int constants with enums, then you'll see your app run slower because there are probably thousands of them (int constants), which all need to be allocated as soon as their classes are loaded, and as all enum are classes, you'd grow the apk size, which could be significant (remember 8GB/4GB devices are still a thing, and 1-2GB ones too) if all apps did the same. Anyway, I'm not here to rewrite Android, I'm just searching for a more concise way to deal with int constants "switches" using the
when
expression