[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
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user