Replace ASTextKitAttributes' objectsEqual with the shared ASObjectIsEqual

This commit is contained in:
Eric Jensen
2016-03-17 10:36:35 -07:00
parent d9ef0922d8
commit 14a389c5e0

View File

@@ -9,6 +9,7 @@
*/
#import <UIKit/UIKit.h>
#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<NSObject> obj1, id<NSObject> 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;