From de15a8270edf1ac399680ee2c665b599c2fc17e1 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 16 Jun 2025 02:08:34 +0300 Subject: [PATCH] init `only_files` with estimated capacity --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 389e7a8..6af57cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,7 +84,9 @@ async fn main() -> Result<()> { initial_peers: peers.initial_peers(), list_only: preload_regex.is_none(), // it is important to blacklist all files preload until initiation - only_files: Some(Vec::new()), + only_files: Some(Vec::with_capacity( + arg.preload_max_filecount.unwrap_or_default(), + )), // the destination folder to preload files match `only_files_regex` // * e.g. images for audio albums output_folder: storage.output_folder(&i, true).ok(),