Merge pull request #1005 from sullis:enum-values

PiperOrigin-RevId: 506138469
This commit is contained in:
Evgenii Kliuchnikov 2023-02-01 09:20:28 +00:00
commit ed1995b6bd

View File

@ -47,8 +47,11 @@ public class Encoder {
*/
FONT;
// see: https://www.gamlor.info/wordpress/2017/08/javas-enum-values-hidden-allocations/
private static final Mode[] ALL_VALUES = values();
public static Mode of(int value) {
return values()[value];
return ALL_VALUES[value];
}
}