Use typed file predicates in SSD tree walkers
ober
1606e732e31b1af61c4ab64d81562a7a4e48f306
--- a/templates/ssd-review.ss +++ b/templates/ssd-review.ss @@ -8235,7 +8235,7 @@ " var sourceBytes = 0L" " ZipOutputStream(BufferedOutputStream(limited)).use { zip ->" " listOf(groundTruthDir, learnedDir, eventsDir, reviewsDir).forEach { dir ->" - " dir.walkTopDown().filter { it.isFile }.forEach { file ->" + " dir.walkTopDown().filter { fileIsRegular(it) }.forEach { file ->" " if (Files.isSymbolicLink(file.toPath())) throw IllegalStateException(\"Storage symlink rejected\")" " entries += 1" " sourceBytes += file.length()" @@ -8463,7 +8463,7 @@ " var bytes = 0L" " listOf(groundTruthDir, learnedDir, eventsDir, reviewsDir).forEach { dir ->" " val targetDir = ensureTreeDir(tree, dir.name)" - " dir.walkTopDown().filter { it.isFile }.forEach { file ->" + " dir.walkTopDown().filter { fileIsRegular(it) }.forEach { file ->" " count += 1" " bytes += file.length()" " if (count > MAX_ZIP_ENTRIES || bytes > MAX_ZIP_TOTAL_BYTES) {"