From c279f3b38b247b405258109443f41cc4aba41a8a Mon Sep 17 00:00:00 2001 From: Charlie Scheer Date: Fri, 31 May 2024 11:22:02 -0600 Subject: [PATCH] Refactored root bundle identifier to not use a while loop --- Simplenote/Bundle+Simplenote.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Simplenote/Bundle+Simplenote.swift b/Simplenote/Bundle+Simplenote.swift index 2030159e8..60addd8a2 100644 --- a/Simplenote/Bundle+Simplenote.swift +++ b/Simplenote/Bundle+Simplenote.swift @@ -19,7 +19,11 @@ extension Bundle { } var url = bundleURL - while !url.lastPathComponent.hasSuffix(Constants.appSuffix) { + + for component in url.pathComponents.reversed() { + guard !component.hasSuffix(Constants.appSuffix) else { + break + } url.deleteLastPathComponent() }