Merge "Don't change the order of test results."

This commit is contained in:
Sudheer Shanka
2019-02-22 18:31:07 +00:00
committed by Android (Google) Code Review

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() {