k_smallest[_by]/tail
: similarities and differences
#904
Labels
k_smallest[_by]/tail
: similarities and differences
#904
I find my new
tail
(#899) quite similar tok_smallest
and its recent variants: we fuse the iterator, collect a limited number of items, than update the resulting slice withiter.for_each
.In
tail
, I consume the iterator (doing so can have wanted side effects) even whenn = 0
whilek_smallest
and variants do not but merely drop it.In
tail
, I have a special case forn = 1
whilek_smallest
and variants do not (it could use a possibly fastermin[_by]
).I think we should update
k_smallest
andk_smallest_general
accordingly.Do you see other differences we should fix?
The text was updated successfully, but these errors were encountered: