Skip to content

Commit eb0360e

Browse files
committed
Break early as soon as we identify at least one file where mapping partial paths is needed
1 parent eb29954 commit eb0360e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/path_rewriting.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,13 @@ pub fn rewrite_paths(
264264
// If all covered paths are direct childs of the source directory, then that function will
265265
// do nothing, and we don't have to do its pre-requisite data gathering.
266266
if has_java {
267-
for path in result_map.keys() {
267+
map_partial_path_needed = result_map.keys().any(|path| {
268268
let mut path = Path::new(path);
269269
if let Some(prefix) = &prefix_dir {
270270
path = path.strip_prefix(prefix).unwrap_or(path);
271271
}
272-
if !source_dir.join(path).exists() {
273-
map_partial_path_needed = true;
274-
}
275-
}
272+
!source_dir.join(path).exists()
273+
})
276274
}
277275

278276
if map_partial_path_needed {

0 commit comments

Comments
 (0)