diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-01-11 03:08:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-11 03:08:05 -0800 |
commit | 581fb3849da8ce97e557bb3633b886fcc369f6cb (patch) | |
tree | 503b3a3657d59218c40712c853640032c51da169 /platform/ios/src/MGLAnnotationImage.m | |
parent | b6cf87f5e763ec6849e4fe34f2dd20fc8a0d0d52 (diff) | |
download | qtlocation-mapboxgl-581fb3849da8ce97e557bb3633b886fcc369f6cb.tar.gz |
[ios, macos] Fix miscellaneous static analyzer warnings (#7670)
* [ios, macos] Fixed static analyzer warnings
Fixed static analyzer warnings in MGLNetworkConfiguration, MGLRasterSource, and MGLShape.
* [ios] Fixed static analyzer warnings
Fixed static analyzer warnings in MGLAnnotationImage.
* [macos] Fixed static analyzer warnings
Fixed static analyzer warnings in MGLAnnotationImage and NSImage(MGLAdditions).
* [ios, macos] Two pointer-equal images are object-equal by definition
Diffstat (limited to 'platform/ios/src/MGLAnnotationImage.m')
-rw-r--r-- | platform/ios/src/MGLAnnotationImage.m | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/platform/ios/src/MGLAnnotationImage.m b/platform/ios/src/MGLAnnotationImage.m index c753e9e54e..9c9c175ab9 100644 --- a/platform/ios/src/MGLAnnotationImage.m +++ b/platform/ios/src/MGLAnnotationImage.m @@ -55,17 +55,14 @@ MGLAnnotationImage *otherAnnotationImage = other; - return ((!_reuseIdentifier && !otherAnnotationImage.reuseIdentifier) || [_reuseIdentifier isEqualToString:otherAnnotationImage.reuseIdentifier]) + return ((!_reuseIdentifier && !otherAnnotationImage.reuseIdentifier) + || [_reuseIdentifier isEqualToString:otherAnnotationImage.reuseIdentifier]) && _enabled == otherAnnotationImage.enabled - && ((!_image && !otherAnnotationImage.image) || [UIImagePNGRepresentation(_image) isEqualToData:UIImagePNGRepresentation(otherAnnotationImage.image)]); + && (_image == otherAnnotationImage.image || [UIImagePNGRepresentation(_image) isEqualToData:UIImagePNGRepresentation(otherAnnotationImage.image)]); } - (NSUInteger)hash { - NSUInteger hash; - hash += [_reuseIdentifier hash]; - hash += _enabled; - hash += [_image hash]; - return hash; + return _reuseIdentifier.hash + _enabled + _image.hash; } - (void)setImage:(UIImage *)image { |