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