Compare commits

...

1 Commits

Author SHA1 Message Date
comp500
c0c318772b Improve file check speed, apparently Files.exists is slow 2019-09-04 03:03:29 +01:00
2 changed files with 2 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ class DownloadTask implements IOptionDetails, IExceptionDetails {
// Don't update files marked with preserve if they already exist on disk // Don't update files marked with preserve if they already exist on disk
if (metadata.preserve) { if (metadata.preserve) {
if (Files.exists(destPath)) { if (destPath.toFile().exists()) {
return; return;
} }
} }

View File

@@ -161,7 +161,7 @@ public class UpdateManager {
// if isn't optional, or is optional but optionValue == true // if isn't optional, or is optional but optionValue == true
if (!entry.getValue().isOptional || entry.getValue().optionValue) { if (!entry.getValue().isOptional || entry.getValue().optionValue) {
if (entry.getValue().cachedLocation != null) { 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; invalid = true;
} }
} else { } else {