summaryrefslogtreecommitdiff
path: root/platform/macos/src/MGLAnnotationImage.m
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-01-11 03:08:05 -0800
committerGitHub <noreply@github.com>2017-01-11 03:08:05 -0800
commit581fb3849da8ce97e557bb3633b886fcc369f6cb (patch)
tree503b3a3657d59218c40712c853640032c51da169 /platform/macos/src/MGLAnnotationImage.m
parentb6cf87f5e763ec6849e4fe34f2dd20fc8a0d0d52 (diff)
downloadqtlocation-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/macos/src/MGLAnnotationImage.m')
-rw-r--r--platform/macos/src/MGLAnnotationImage.m8
1 files changed, 2 insertions, 6 deletions
diff --git a/platform/macos/src/MGLAnnotationImage.m b/platform/macos/src/MGLAnnotationImage.m
index f9f900344a..d19dbe5dfc 100644
--- a/platform/macos/src/MGLAnnotationImage.m
+++ b/platform/macos/src/MGLAnnotationImage.m
@@ -53,15 +53,11 @@
return ((!_reuseIdentifier && !otherAnnotationImage.reuseIdentifier) || [_reuseIdentifier isEqualToString:otherAnnotationImage.reuseIdentifier])
&& _selectable == otherAnnotationImage.selectable
&& ((!_cursor && !otherAnnotationImage.cursor) || [_cursor isEqual:otherAnnotationImage.cursor])
- && ((!_image && !otherAnnotationImage.image) || [[_image TIFFRepresentation] isEqualToData:[otherAnnotationImage.image TIFFRepresentation]]);
+ && (_image == otherAnnotationImage.image || [[_image TIFFRepresentation] isEqualToData:[otherAnnotationImage.image TIFFRepresentation]]);
}
- (NSUInteger)hash {
- NSUInteger hash;
- hash += [_reuseIdentifier hash];
- hash += _selectable;
- hash += [_image hash];
- return hash;
+ return _reuseIdentifier.hash + @(_selectable).hash + _image.hash;
}
@end