Merge "Fix ColorSpace#get allocating"

This commit is contained in:
TreeHugger Robot
2019-10-17 00:56:55 +00:00
committed by Android (Google) Code Review

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];
}