Correct sortedness check in profile statistics

This commit is contained in:
Mateusz Naściszewski 2017-08-28 13:17:26 +02:00
parent ced303b9cb
commit 1c0f569bb3
No known key found for this signature in database
GPG key ID: 6A6067123E4CAF6E

View file

@ -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
});