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