- Notifications
You must be signed in to change notification settings - Fork 335
Closed
Description
Looking at how pub fn cartesian_product<I, J>(mut i: I, j: J) -> Product<I, J>
initialises Product
, one can see that it yields the first item in i
.
Wouldn't it be better if Product.a_cur
was an Option<Option<I::Item>>
and initialized as None
, rather than initializing it by starting the consumption of i
?
This may cause problems if iteration over i
has side effects.
Same with Product.b
too. No reason to clone it ahead of time.
I haven't looked deep into at the implementation of multi_cartesian_product
but it may be a similar situation there too.
Metadata
Metadata
Assignees
Labels
No labels