mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic scrape handler: preallocate stats vec better
This commit is contained in:
parent
13790b5d60
commit
789783cfe4
1 changed files with 4 additions and 1 deletions
|
|
@ -141,7 +141,10 @@ pub fn handle_scrape_requests(
|
|||
if !state.connections.contains_key(&connection_key){
|
||||
return None;
|
||||
}
|
||||
let mut stats: Vec<TorrentScrapeStatistics> = Vec::with_capacity(256);
|
||||
|
||||
let mut stats: Vec<TorrentScrapeStatistics> = Vec::with_capacity(
|
||||
request.info_hashes.len()
|
||||
);
|
||||
|
||||
for info_hash in request.info_hashes.iter() {
|
||||
if let Some(torrent_data) = state.torrents.get(info_hash){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue