Simplify ASMapNode.setAnnotations

This commit is contained in:
Adlai Holler
2016-02-25 10:40:38 -08:00
parent 2fbc7b0942
commit 60f5ba2d17

View File

@@ -260,12 +260,10 @@
- (void)setAnnotations:(NSArray *)annotations - (void)setAnnotations:(NSArray *)annotations
{ {
if (annotations == nil) { annotations = [annotations copy] ?: @[];
annotations = @[];
}
ASDN::MutexLocker l(_propertyLock); ASDN::MutexLocker l(_propertyLock);
_annotations = [annotations copy]; _annotations = annotations;
if (self.isLiveMap) { if (self.isLiveMap) {
[_mapView removeAnnotations:_mapView.annotations]; [_mapView removeAnnotations:_mapView.annotations];
[_mapView addAnnotations:annotations]; [_mapView addAnnotations:annotations];