perf: prealloc vec (#20721)

Co-authored-by: weixie.cui <weixie.cui@okg.com>
This commit is contained in:
cui
2026-01-05 21:53:17 +08:00
committed by GitHub
parent f920ffd5f9
commit 96ff33120e

View File

@@ -680,7 +680,7 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> DatabaseProvider<TX, N> {
.zip(headers)
.collect::<Vec<_>>();
let mut inputs = Vec::new();
let mut inputs = Vec::with_capacity(present_headers.len());
for (tx_range, header) in &present_headers {
let transactions = if tx_range.is_empty() {
Vec::new()