Closed itchyny closed 2 years ago
This PR improves definitions of sort_by, min_by, and max_by. The sort_by(f) filter keeps the original order when f emits the same value. Also, fixes #40. The {min,max}_by(f) emits the element with {smaller,larger} index when f emits the same value.
sort_by
min_by
max_by
sort_by(f)
f
{min,max}_by(f)
This PR improves definitions of
sort_by
,min_by
, andmax_by
. Thesort_by(f)
filter keeps the original order whenf
emits the same value. Also, fixes #40. The{min,max}_by(f)
emits the element with {smaller,larger} index whenf
emits the same value.