Procházet zdrojové kódy

Preallocate commit list

Mark Rousskov před 5 roky
rodič
revize
bb46e8f2e5
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/db/rustc_commits.rs

+ 1 - 1
src/db/rustc_commits.rs

@@ -33,7 +33,7 @@ pub async fn get_commits_with_artifacts(db: &DbClient) -> anyhow::Result<Vec<Com
         .await
         .context("Getting commit data")?;
 
-    let mut data = Vec::new();
+    let mut data = Vec::with_capacity(commits.len());
     for commit in commits {
         let sha: String = commit.get(0);
         let parent_sha: String = commit.get(1);