File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1549,13 +1549,18 @@ mod tests {
15491549 ) {
15501550 let channels = rm. channels . lock ( ) . unwrap ( ) ;
15511551 let channel = channels. get ( & incoming_scid) . unwrap ( ) ;
1552- let slots = channel. general_bucket . channels_slots . get ( & outgoing_scid) . unwrap ( ) ;
1553- let used_count = slots
1554- . iter ( )
1555- . filter ( |slot_idx| {
1556- channel. general_bucket . slots_occupied [ * * slot_idx as usize ] == Some ( outgoing_scid)
1557- } )
1558- . count ( ) ;
1552+ let general_bucket = & channel. general_bucket ;
1553+ let slots = general_bucket. channels_slots . get ( & outgoing_scid) . unwrap ( ) ;
1554+
1555+ let mut used_count = 0 ;
1556+ for entry in slots {
1557+ if slot_used ( * entry) {
1558+ // A slot flagged as used by this channel must also be marked occupied in the
1559+ // bucket-wide bitset.
1560+ assert ! ( general_bucket. is_slot_occupied( slot_index( * entry) ) ) ;
1561+ used_count += 1 ;
1562+ }
1563+ }
15591564 assert_eq ! ( used_count, expected_count) ;
15601565 }
15611566
You can’t perform that action at this time.
0 commit comments