mirror of
https://github.com/google/brotli.git
synced 2024-11-09 13:40:06 +00:00
Merge pull request #1005 from sullis:enum-values
PiperOrigin-RevId: 506138469
This commit is contained in:
commit
ed1995b6bd
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user