From 14a389c5e0a9987f9e3077f369d6cfd9cc86ea02 Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Thu, 17 Mar 2016 10:36:35 -0700 Subject: [PATCH] Replace ASTextKitAttributes' objectsEqual with the shared ASObjectIsEqual --- AsyncDisplayKit/TextKit/ASTextKitAttributes.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/AsyncDisplayKit/TextKit/ASTextKitAttributes.h b/AsyncDisplayKit/TextKit/ASTextKitAttributes.h index e18d615a3f..7fcb8ff144 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitAttributes.h +++ b/AsyncDisplayKit/TextKit/ASTextKitAttributes.h @@ -9,6 +9,7 @@ */ #import +#import "ASEqualityHelpers.h" #ifndef ComponentKit_ASTextKitAttributes_h #define ComponentKit_ASTextKitAttributes_h @@ -22,11 +23,6 @@ extern NSString *const ASTextKitTruncationAttributeName; */ extern NSString *const ASTextKitEntityAttributeName; -static inline BOOL _objectsEqual(id obj1, id obj2) -{ - return obj1 == obj2 || [obj1 isEqual:obj2]; -} - /** All NSObject values in this struct should be copied when passed into the TextComponent. */ @@ -136,11 +132,11 @@ struct ASTextKitAttributes { && layoutManagerCreationBlock == other.layoutManagerCreationBlock && textStorageCreationBlock == other.textStorageCreationBlock && CGSizeEqualToSize(shadowOffset, other.shadowOffset) - && _objectsEqual(exclusionPaths, other.exclusionPaths) - && _objectsEqual(avoidTailTruncationSet, other.avoidTailTruncationSet) - && _objectsEqual(shadowColor, other.shadowColor) - && _objectsEqual(attributedString, other.attributedString) - && _objectsEqual(truncationAttributedString, other.truncationAttributedString); + && ASObjectIsEqual(exclusionPaths, other.exclusionPaths) + && ASObjectIsEqual(avoidTailTruncationSet, other.avoidTailTruncationSet) + && ASObjectIsEqual(shadowColor, other.shadowColor) + && ASObjectIsEqual(attributedString, other.attributedString) + && ASObjectIsEqual(truncationAttributedString, other.truncationAttributedString); } size_t hash() const;