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;