Explorar el Código

Preallocate commit list

Mark Rousskov hace 5 años
padre
commit
bb46e8f2e5
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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);