We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Vec::with_capacity
1 parent c123e0e commit 3b946ecCopy full SHA for 3b946ec
lightning-transaction-sync/src/electrum.rs
@@ -186,8 +186,9 @@ where
186
// First, check the confirmation status of registered transactions as well as the
187
// status of dependent transactions of registered outputs.
188
let mut confirmed_txs = Vec::new();
189
- let mut watched_script_pubkeys = Vec::new();
190
- let mut watched_txs = Vec::new();
+ let mut watched_script_pubkeys = Vec::with_capacity(
+ sync_state.watched_transactions.len() + sync_state.watched_outputs.len());
191
+ let mut watched_txs = Vec::with_capacity(sync_state.watched_transactions.len());
192
let watched_outputs = sync_state.watched_outputs.values().collect::<Vec<_>>();
193
194
for txid in &sync_state.watched_transactions {
0 commit comments