mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Replace ASTextKitAttributes' objectsEqual with the shared ASObjectIsEqual
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user