]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #59138 - timvermeulen:simplify_select_fold1, r=sfackler
authorMazdak Farrokhzad <twingoow@gmail.com>
Wed, 13 Mar 2019 02:33:57 +0000 (03:33 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Mar 2019 02:33:57 +0000 (03:33 +0100)
Simplify Iterator::{min, max}

This PR simplifies the `select_fold1` helper method used to implmement `Iterator::{min, min_by, min_by_key, max, max_by, max_by_key}` by removing the projection argument, which was only used by the implementations of `min_by_key` and `max_by_key`.

I also added tests to ensure that the stability as mentioned in the comments of `min` and `max` is preserved, and fixed the `iter::{bench_max, bench_max_by_key}` benchmarks which the compiler presumably was able to collapse into closed-form expressions. None of the benchmark results were impacted, I suspect their generated assembly didn't change.


Trivial merge