Fix ColorSpace#get allocating

Test: none
Change-Id: Ia4d380a74ac8f99ac408f52a602713823db43f50
This commit is contained in:
John Reck
2019-10-16 16:18:28 -07:00
parent 3441faa045
commit da94981b19

View File

@@ -1380,9 +1380,9 @@ public abstract class ColorSpace {
*/
@NonNull
static ColorSpace get(@IntRange(from = MIN_ID, to = MAX_ID) int index) {
if (index < 0 || index >= Named.values().length) {
if (index < 0 || index >= sNamedColorSpaces.length) {
throw new IllegalArgumentException("Invalid ID, must be in the range [0.." +
Named.values().length + ")");
sNamedColorSpaces.length + ")");
}
return sNamedColorSpaces[index];
}