Don't change the order of test results.

Test: atest apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java
Change-Id: Ie21030581ae81509eaa5b3ec31d5e6978dcb23d4
This commit is contained in:
Sudheer Shanka
2019-02-11 00:23:29 -08:00
parent 0671c44a85
commit f69fc9c445

View File

@@ -60,11 +60,13 @@ public class BenchmarkResults {
if (size == 0) {
return 0f;
}
Collections.sort(mResults);
final ArrayList<Long> resultsCopy = new ArrayList<>(mResults);
Collections.sort(resultsCopy);
final int idx = size / 2;
return size % 2 == 0
? (double) (mResults.get(idx) + mResults.get(idx - 1)) / 2
: mResults.get(idx);
? (double) (resultsCopy.get(idx) + resultsCopy.get(idx - 1)) / 2
: resultsCopy.get(idx);
}
private double standardDeviation() {