Skip to content

Commit ffe880b

Browse files
Kobzoldjc
authored andcommitted
Skip manifest loading if there are no components/targets to check
1 parent 8d67a1b commit ffe880b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/toolchain/distributable.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ impl<'a> DistributableToolchain<'a> {
134134
components: &[&str],
135135
targets: &[&str],
136136
) -> anyhow::Result<bool> {
137+
// Performance optimization: avoid loading the manifest (which can be expensive)
138+
// if there are no components/targets to check.
139+
if components.is_empty() && targets.is_empty() {
140+
return Ok(true);
141+
}
142+
137143
let manifestation = self.get_manifestation()?;
138144
let manifest = manifestation.load_manifest()?;
139145
let manifest = match manifest {

0 commit comments

Comments
 (0)