diff --git a/Sources/AXorcist/Core/AppLocator.swift b/Sources/AXorcist/Core/AppLocator.swift index f3b44f1..fe500bd 100644 --- a/Sources/AXorcist/Core/AppLocator.swift +++ b/Sources/AXorcist/Core/AppLocator.swift @@ -25,10 +25,8 @@ public enum AppLocator { $0.activationPolicy == .regular && !$0.isHidden && $0.bundleIdentifier != nil } - for app in visibleApps { - if Self.point(mouseLocation, isInsideWindowOf: app) { - return app - } + for app in visibleApps where Self.point(mouseLocation, isInsideWindowOf: app) { + return app } // Fallback. diff --git a/Tests/AXorcistTests/InputDriverTests.swift b/Tests/AXorcistTests/InputDriverTests.swift index 2d0ebde..afa68ba 100644 --- a/Tests/AXorcistTests/InputDriverTests.swift +++ b/Tests/AXorcistTests/InputDriverTests.swift @@ -13,7 +13,7 @@ struct InputDriverTests { @Test("cachedLocation populates cache when empty") func cachedLocationPopulatesCache() { - var cache: CGPoint? = nil + var cache: CGPoint? _ = InputDriver.cachedLocation(using: &cache) // If running in CI without UI, location may be nil; just assert cache mirrors result. #expect(cache == InputDriver.currentLocation())