diff options
Diffstat (limited to 'platform/macos/src/MGLMapView.mm')
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 68f36e044b..e72a755f51 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1820,7 +1820,7 @@ public: return annotationContext.annotation; } -/// Returns the annotation tag assigned to the given annotation. Relatively expensive. +/// Returns the annotation tag assigned to the given annotation. - (MGLAnnotationTag)annotationTagForAnnotation:(id <MGLAnnotation>)annotation { if (!annotation || _annotationTagsByAnnotation.count(annotation) == 0) { return MGLAnnotationTagNotFound; @@ -1848,8 +1848,7 @@ public: NSAssert([annotation conformsToProtocol:@protocol(MGLAnnotation)], @"Annotation does not conform to MGLAnnotation"); // adding the same annotation object twice is a no-op - if ([self.annotations containsObject:annotation]) - { + if (_annotationTagsByAnnotation.count(annotation) != 0) { continue; } |