aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-09-01 15:04:56 -0500
committerGitHub <noreply@github.com>2017-09-01 15:04:56 -0500
commit2550b47decbc9876d96a459e399658ca54998bda (patch)
treef6d5222798863d19c85014bd5209befd416fd27c
parentfd833d9f18cd9196502b9768ab0ac8c1498b2f68 (diff)
parent1c0f569bb337b8868ed2e77de4c3f14e3bb8c4e6 (diff)
downloadservo-2550b47decbc9876d96a459e399658ca54998bda.tar.gz
servo-2550b47decbc9876d96a459e399658ca54998bda.zip
Auto merge of #18272 - mateon1:fix/profile-sorted-assert, r=emilio
Correct "is sorted" check in profile statistics <!-- Please describe your changes on the following line: --> Correct the debug_assert check for whether or not statistics collected by the --profile flag are sorted. I'm not sure how I could add a test for this change, and whether that is necessary. I also wonder if it makes sense to replace the sort_by calls (currently using explicit comparisons) in this file with something like ``` data.sort_by(|a, b| a.partial_cmp(b).expect("no NaN in collected statistics")) ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18270 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18272) <!-- Reviewable:end -->
-rw-r--r--components/profile/time.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/profile/time.rs b/components/profile/time.rs
index 16495b63d43..2eb48f57a13 100644
--- a/components/profile/time.rs
+++ b/components/profile/time.rs
@@ -328,7 +328,7 @@ impl Profiler {
/// Get tuple (mean, median, min, max) for profiler statistics.
pub fn get_statistics(data: &[f64]) -> (f64, f64, f64, f64) {
data.iter().fold(-f64::INFINITY, |a, &b| {
- debug_assert!(a < b, "Data must be sorted");
+ debug_assert!(a <= b, "Data must be sorted");
b
});