Skip to content

Commit

Permalink
reduce file access
Browse files Browse the repository at this point in the history
At least on Windows the repeated invocation of file.exists takes a huge
amount of time.
  • Loading branch information
Bananeweizen authored and laeubi committed Dec 18, 2024
1 parent 968deec commit 88bea6e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ public File getLocation(boolean fetch) {
if (projectLocation != null) {
return projectLocation;
}
if (fetch && locationSupplier != null && (location == null || !location.exists())) {
if (fetch && locationSupplier != null && location == null) {
File file = locationSupplier.apply(this);
if (file != null) {
location = ArtifactCollection.normalizeLocation(file);
if (!location.exists()) {
location = null;
}
}
}
return location;
Expand Down

0 comments on commit 88bea6e

Please sign in to comment.