From 225c68ecd1516566e0802d0746049d408b4c9d85 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Mon, 5 Dec 2022 11:51:04 +0100 Subject: [PATCH] Fix display of total optimization count --- Sources/Generator/Processing/ImageGenerator.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Generator/Processing/ImageGenerator.swift b/Sources/Generator/Processing/ImageGenerator.swift index ec67b91..962d1eb 100644 --- a/Sources/Generator/Processing/ImageGenerator.swift +++ b/Sources/Generator/Processing/ImageGenerator.swift @@ -266,8 +266,9 @@ final class ImageGenerator { let all = generatedImages .filter { imageOptimSupportedFileExtensions.contains($0.lastComponentAfter(".")) } .map { output.appendingPathComponent($0).path } - for i in stride(from: 0, to: all.count, by: imageOptimizationBatchSize) { - let endIndex = min(i+imageOptimizationBatchSize, all.count) + numberOfImagesToOptimize = all.count + for i in stride(from: 0, to: numberOfImagesToOptimize, by: imageOptimizationBatchSize) { + let endIndex = min(i+imageOptimizationBatchSize, numberOfImagesToOptimize) let batch = all[i..