File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -365,15 +365,13 @@ where
365365 }
366366
367367 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
368- let has_cur = matches ! ( self . a_cur, Some ( Some ( _) ) ) as usize ;
369368 // Not ExactSizeIterator because size may be larger than usize
370- let ( b_min, b_max) = self . b . size_hint ( ) ;
371-
372369 // Compute a * b_orig + b for both lower and upper bound
373- size_hint:: add (
374- size_hint:: mul ( self . a . size_hint ( ) , self . b_orig . size_hint ( ) ) ,
375- ( b_min * has_cur, b_max. map ( move |x| x * has_cur) ) ,
376- )
370+ let mut sh = size_hint:: mul ( self . a . size_hint ( ) , self . b_orig . size_hint ( ) ) ;
371+ if matches ! ( self . a_cur, Some ( Some ( _) ) ) {
372+ sh = size_hint:: add ( sh, self . b . size_hint ( ) ) ;
373+ }
374+ sh
377375 }
378376
379377 fn fold < Acc , G > ( self , mut accum : Acc , mut f : G ) -> Acc
You can’t perform that action at this time.
0 commit comments