code review updates: sprite_atlas brackets and nullable removed for reuseIdentifier of annotationImage

This commit is contained in:
Romain Quidet
2015-12-15 11:56:03 +01:00
committed by Minh Nguyễn
parent af45d87e54
commit b8be1f0632
3 changed files with 5 additions and 8 deletions

View File

@@ -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 */

View File

@@ -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];

View File

@@ -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);
}