From cf107bca4f5f6b2423d90d3e26af163ffac7cdaf Mon Sep 17 00:00:00 2001 From: askalski Date: Sat, 16 Jan 2016 16:39:48 +0100 Subject: [PATCH] replacing custom fmin function with standard f32.min in components/layout/display_list_builder.rs --- components/layout/display_list_builder.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 0c9a767b0ad..272ef723a13 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -1928,22 +1928,14 @@ struct StopRun { stop_count: usize, } -fn fmin(a: f32, b: f32) -> f32 { - if a < b { - a - } else { - b - } -} - fn position_to_offset(position: LengthOrPercentage, Au(total_length): Au) -> f32 { match position { LengthOrPercentage::Length(Au(length)) => { - fmin(1.0, (length as f32) / (total_length as f32)) + (1.0f32).min(length as f32 / total_length as f32) } LengthOrPercentage::Percentage(percentage) => percentage as f32, LengthOrPercentage::Calc(calc) => - fmin(1.0, calc.percentage() + (calc.length().0 as f32) / (total_length as f32)), + (1.0f32).min(calc.percentage() + (calc.length().0 as f32) / (total_length as f32)), } }