@@ -457,22 +457,23 @@ impl<'a> CoverageSpansGenerator<'a> {
457457 /// In either case, no more spans will match the span of `pending_dups`, so
458458 /// add the `pending_dups` if they don't overlap `curr`, and clear the list.
459459 fn maybe_flush_pending_dups ( & mut self ) {
460- if let Some ( dup) = self . pending_dups . last ( )
461- && dup. span != self . prev ( ) . span
462- {
463- debug ! (
464- " SAME spans, but pending_dups are NOT THE SAME, so BCBs matched on \
465- previous iteration, or prev started a new disjoint span"
466- ) ;
467- if dup. span . hi ( ) <= self . curr ( ) . span . lo ( ) {
468- let pending_dups = self . pending_dups . split_off ( 0 ) ;
469- for dup in pending_dups. into_iter ( ) {
470- debug ! ( " ...adding at least one pending={:?}" , dup) ;
471- self . push_refined_span ( dup) ;
472- }
473- } else {
474- self . pending_dups . clear ( ) ;
460+ let Some ( last_dup) = self . pending_dups . last ( ) else { return } ;
461+ if last_dup. span == self . prev ( ) . span {
462+ return ;
463+ }
464+
465+ debug ! (
466+ " SAME spans, but pending_dups are NOT THE SAME, so BCBs matched on \
467+ previous iteration, or prev started a new disjoint span"
468+ ) ;
469+ if last_dup. span . hi ( ) <= self . curr ( ) . span . lo ( ) {
470+ let pending_dups = self . pending_dups . split_off ( 0 ) ;
471+ for dup in pending_dups. into_iter ( ) {
472+ debug ! ( " ...adding at least one pending={:?}" , dup) ;
473+ self . push_refined_span ( dup) ;
475474 }
475+ } else {
476+ self . pending_dups . clear ( ) ;
476477 }
477478 }
478479
0 commit comments