Prefer is_empty over len when option is available.

This commit is contained in:
Corey Farwell 2016-01-29 22:49:47 -05:00
parent f0122efcec
commit f62e83c848

View file

@ -401,7 +401,7 @@ pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) ->
}
fn split_first_fragment_at_newline_if_necessary(fragments: &mut LinkedList<Fragment>) {
if fragments.len() < 1 {
if fragments.is_empty() {
return
}