Avoid re-creating directories in async unzip (#1155)

This PR extends the optimizations from #1154 to other unzip paths.
This commit is contained in:
Charlie Marsh 2024-01-28 06:30:38 -08:00 committed by GitHub
parent 3d10f344f3
commit a25a1f2958
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 9 deletions

View file

@ -189,10 +189,9 @@ fn unpack_wheel_files<R: Read + Seek>(
continue;
}
if let Some(p) = out_path.parent() {
if !created_dirs.contains(p) {
fs::create_dir_all(p)?;
created_dirs.insert(p.to_path_buf());
if let Some(parent) = out_path.parent() {
if created_dirs.insert(parent.to_path_buf()) {
fs::create_dir_all(parent)?;
}
}
let mut outfile = BufWriter::new(File::create(&out_path)?);