Skip to content

Commit

Permalink
Improve file check speed, apparently Files.exists is slow
Browse files Browse the repository at this point in the history
  • Loading branch information
comp500 committed Sep 4, 2019
1 parent 580408b commit c0c3187
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void download(String packFolder, SpaceSafeURI indexUri) {

// Don't update files marked with preserve if they already exist on disk
if (metadata.preserve) {
if (Files.exists(destPath)) {
if (destPath.toFile().exists()) {
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void start() {
// if isn't optional, or is optional but optionValue == true
if (!entry.getValue().isOptional || entry.getValue().optionValue) {
if (entry.getValue().cachedLocation != null) {
if (!Files.exists(Paths.get(opts.packFolder, entry.getValue().cachedLocation))) {
if (!Paths.get(opts.packFolder, entry.getValue().cachedLocation).toFile().exists()) {
invalid = true;
}
} else {
Expand Down

0 comments on commit c0c3187

Please sign in to comment.