am be10a866: am 9f004920: Merge "Reduce cost of span type checking" into mnc-dev

* commit 'be10a86620947bfee882c50ae725ceb10cbae98f':
  Reduce cost of span type checking
This commit is contained in:
Chris Craik
2015-07-13 23:33:08 +00:00
committed by Android Git Automerger

View File

@@ -214,10 +214,6 @@ import java.lang.reflect.Array;
Object ret1 = null;
for (int i = 0; i < spanCount; i++) {
if (kind != null && !kind.isInstance(spans[i])) {
continue;
}
int spanStart = data[i * COLUMNS + START];
int spanEnd = data[i * COLUMNS + END];
@@ -237,6 +233,11 @@ import java.lang.reflect.Array;
}
}
// verify span class as late as possible, since it is expensive
if (kind != null && !kind.isInstance(spans[i])) {
continue;
}
if (count == 0) {
ret1 = spans[i];
count++;