Add more deep compares when setting public properties to the same value

This commit is contained in:
Adlai Holler 2015-10-05 23:48:48 -07:00
parent 2e5da5599d
commit 87caed27e2
3 changed files with 6 additions and 5 deletions

View File

@ -217,7 +217,7 @@
- (void)setTypingAttributes:(NSDictionary *)typingAttributes
{
if (_typingAttributes == typingAttributes)
if (ASObjectIsEqual(typingAttributes, _typingAttributes))
return;
_typingAttributes = [typingAttributes copy];

View File

@ -18,6 +18,7 @@
#import "ASImageNode+CGExtras.h"
#import "ASInternalHelpers.h"
#import "ASEqualityHelpers.h"
@interface _ASImageNodeDrawParameters : NSObject
@ -123,7 +124,7 @@
- (void)setImage:(UIImage *)image
{
ASDN::MutexLocker l(_imageLock);
if (_image != image) {
if (!ASObjectIsEqual(_image, image)) {
_image = image;
ASDN::MutexUnlocker u(_imageLock);

View File

@ -11,7 +11,7 @@
#import "ASBasicImageDownloader.h"
#import "ASDisplayNode+Subclasses.h"
#import "ASThread.h"
#import "ASEqualityHelpers.h"
@interface ASNetworkImageNode ()
{
@ -70,7 +70,7 @@
{
ASDN::MutexLocker l(_lock);
if (URL == _URL || [URL isEqual:_URL]) {
if (ASObjectIsEqual(URL, _URL)) {
return;
}
@ -96,7 +96,7 @@
{
ASDN::MutexLocker l(_lock);
if (defaultImage == _defaultImage || [defaultImage isEqual:_defaultImage]) {
if (ASObjectIsEqual(defaultImage, _defaultImage)) {
return;
}
_defaultImage = defaultImage;