Skip to content

Commit

Permalink
chore: improve speed of resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Jan 25, 2023
1 parent 4fe7d59 commit dcc8561
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/vpm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,13 +1040,20 @@ impl UnityProject {
}

pub async fn resolve(&self, env: &Environment) -> io::Result<()> {
for (pkg, dep) in self.manifest.locked() {
let pkg = env
.find_package_by_name(&pkg, VersionSelector::Specific(&dep.version))
.await?
.expect("some package in manifest.json not found");
env.add_package(&pkg, &self.packages_dir).await?;
}
try_join_all(
self.manifest
.locked()
.into_iter()
.map(|(pkg, dep)| async move {
let pkg = env
.find_package_by_name(&pkg, VersionSelector::Specific(&dep.version))
.await?
.expect("some package in manifest.json not found");
env.add_package(&pkg, &self.packages_dir).await?;
io::Result::Ok(())
}),
)
.await?;
Ok(())
}
}
Expand Down

0 comments on commit dcc8561

Please sign in to comment.