From 3a5e38ea618bcd6491fc87e82f80caffbd9a0cfd Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 14:40:14 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Optimize=20`isAnnotationSelected`?= =?UTF-8?q?=20complexity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: esenmx <43244505+esenmx@users.noreply.github.com> --- .../mapkit_flutter/Annotations/AnnotationController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift b/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift index b5dab0d..65bdf34 100644 --- a/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift +++ b/darwin/mapkit_flutter/Sources/mapkit_flutter/Annotations/AnnotationController.swift @@ -132,7 +132,7 @@ extension MapKitViewHost { } func isAnnotationSelected(with id: String) -> Bool { - return self.mapView.selectedAnnotations.contains(where: { annotation in return self.getAnnotation(with: id) == (annotation as? FlutterAnnotation) }) + return self.mapView.selectedAnnotations.contains(where: { annotation in return (annotation as? FlutterAnnotation)?.id == id }) } private func removeAnnotation(id: String) {