Clean up ManifestTestListAdapter's filterTests loop.
The logic is effectively the same but the inner loop runs
faster.
Change-Id: Ia49a692048e238c2920058ccbbf4516e48ae86b5
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
index 0b73642..ebddf4f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
@@ -305,11 +305,8 @@
List<TestListItem> filterTests(List<TestListItem> tests) {
List<TestListItem> filteredTests = new ArrayList<TestListItem>();
for (TestListItem test : tests) {
- String[] excludedFeatures = test.excludedFeatures;
- String[] requiredFeatures = test.requiredFeatures;
- String[] applicableFeatures = test.applicableFeatures;
- if (!hasAnyFeature(excludedFeatures) && hasAllFeatures(requiredFeatures)) {
- if (hasAnyFeature(applicableFeatures) || hasAllFeatures(applicableFeatures)) {
+ if (!hasAnyFeature(test.excludedFeatures) && hasAllFeatures(test.requiredFeatures)) {
+ if (test.applicableFeatures == null || hasAnyFeature(test.applicableFeatures)) {
filteredTests.add(test);
}
}