Simplify optional call chain

GitOrigin-RevId: faa12da5460431ff3edc081553a764fe7ab48c4e
This commit is contained in:
Bart van Helvert
2023-09-11 18:55:50 +02:00
committed by intellij-monorepo-bot
parent 188434d9d9
commit 9f7df4c30b

View File

@@ -70,7 +70,7 @@ public class DeleteAction extends PatchAction {
boolean canDelete = true;
if (Files.isDirectory(toFile.toPath(), LinkOption.NOFOLLOW_LINKS)) {
try (Stream<Path> children = Files.list(toFile.toPath())) {
canDelete = !children.findAny().isPresent();
canDelete = children.findAny().isEmpty();
}
}