From b8be1f0632bf3ba2daf128c55692f7956af606cb Mon Sep 17 00:00:00 2001 From: Romain Quidet Date: Tue, 15 Dec 2015 11:56:03 +0100 Subject: [PATCH] code review updates: sprite_atlas brackets and nullable removed for reuseIdentifier of annotationImage --- include/mbgl/ios/MGLAnnotationImage.h | 2 +- platform/ios/MGLAnnotationImage.m | 4 ++-- src/mbgl/sprite/sprite_atlas.cpp | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/mbgl/ios/MGLAnnotationImage.h b/include/mbgl/ios/MGLAnnotationImage.h index efc79ffb9..f48a3cfb4 100644 --- a/include/mbgl/ios/MGLAnnotationImage.h +++ b/include/mbgl/ios/MGLAnnotationImage.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN * @param image The image to be displayed for the annotation. * @param reuseIdentifier The string that identifies that this annotation image is reusable. * @return The initialized annotation image object or `nil` if there was a problem initializing the object. */ -+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(nullable NSString *)reuseIdentifier; ++ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier; /** @name Getting and Setting Attributes */ diff --git a/platform/ios/MGLAnnotationImage.m b/platform/ios/MGLAnnotationImage.m index ad560552c..374ed162f 100644 --- a/platform/ios/MGLAnnotationImage.m +++ b/platform/ios/MGLAnnotationImage.m @@ -9,12 +9,12 @@ @implementation MGLAnnotationImage -+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(nullable NSString *)reuseIdentifier ++ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier { return [[self alloc] initWithImage:image reuseIdentifier:reuseIdentifier]; } -- (instancetype)initWithImage:(UIImage *)image reuseIdentifier:(nullable NSString *)reuseIdentifier +- (instancetype)initWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier { self = [super init]; diff --git a/src/mbgl/sprite/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp index b04d8edc5..202218f51 100644 --- a/src/mbgl/sprite/sprite_atlas.cpp +++ b/src/mbgl/sprite/sprite_atlas.cpp @@ -187,12 +187,9 @@ void SpriteAtlas::updateDirty() { // The two names match; Holder& holder = imageIterator->second; holder.texture = spriteIterator->second; - if (holder.texture != nullptr) - { + if (holder.texture != nullptr) { copy(holder, imageIterator->first.second); - } - else - { + } else { images.erase(imageIterator); }