File tree 1 file changed +1
-2
lines changed
1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -1579,14 +1579,13 @@ where
1579
1579
}
1580
1580
1581
1581
fn list_channels_with_filter < Fn : FnMut ( & ( & [ u8 ; 32 ] , & Channel < <SP :: Target as SignerProvider >:: Signer > ) ) -> bool + Copy > ( & self , f : Fn ) -> Vec < ChannelDetails > {
1582
- let mut res = Vec :: new ( ) ;
1583
1582
// Allocate our best estimate of the number of channels we have in the `res`
1584
1583
// Vec. Sadly the `short_to_chan_info` map doesn't cover channels without
1585
1584
// a scid or a scid alias, and the `id_to_peer` shouldn't be used outside
1586
1585
// of the ChannelMonitor handling. Therefore reallocations may still occur, but is
1587
1586
// unlikely as the `short_to_chan_info` map often contains 2 entries for
1588
1587
// the same channel.
1589
- res. reserve ( self . short_to_chan_info . read ( ) . unwrap ( ) . len ( ) ) ;
1588
+ let mut res = Vec :: with_capacity ( self . short_to_chan_info . read ( ) . unwrap ( ) . len ( ) ) ;
1590
1589
{
1591
1590
let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
1592
1591
let per_peer_state = self . per_peer_state . read ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments