From 72c4f2ac313928b25cdd4d556d9a32e807f08b04 Mon Sep 17 00:00:00 2001 From: a dinosaur Date: Fri, 22 Nov 2024 20:08:07 +1100 Subject: [PATCH] More efficient empty line check --- Sources/apk/Index/ApkRawIndex.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/apk/Index/ApkRawIndex.swift b/Sources/apk/Index/ApkRawIndex.swift index 262f5c2..c20a7e3 100644 --- a/Sources/apk/Index/ApkRawIndex.swift +++ b/Sources/apk/Index/ApkRawIndex.swift @@ -15,7 +15,7 @@ struct ApkRawIndex { recordLines.reserveCapacity(15) for line in lines { - if line.trimmingCharacters(in: .whitespaces).isEmpty { + if line.isEmpty || line.allSatisfy(\.isWhitespace) { if !recordLines.isEmpty { packages.append(try .init(parsingEntryLines: recordLines)) recordLines.removeAll(keepingCapacity: true)