|  | 
| 19 | 19 | 
 | 
| 20 | 20 | #import "ASTextNodeRenderer.h" | 
| 21 | 21 | #import "ASTextNodeShadower.h" | 
|  | 22 | +#import "ASEqualityHelpers.h" | 
| 22 | 23 | 
 | 
| 23 | 24 | static const NSTimeInterval ASTextNodeHighlightFadeOutDuration = 0.15; | 
| 24 | 25 | static const NSTimeInterval ASTextNodeHighlightFadeInDuration = 0.1; | 
| @@ -315,7 +316,7 @@ - (void)_invalidateShadower | 
| 315 | 316 | #pragma mark - Modifying User Text | 
| 316 | 317 | 
 | 
| 317 | 318 | - (void)setAttributedString:(NSAttributedString *)attributedString { | 
| 318 |  | -  if (attributedString == _attributedString) { | 
|  | 319 | +  if (ASObjectIsEqual(attributedString, _attributedString)) { | 
| 319 | 320 |     return; | 
| 320 | 321 |   } | 
| 321 | 322 | 
 | 
| @@ -349,14 +350,16 @@ - (void)setAttributedString:(NSAttributedString *)attributedString { | 
| 349 | 350 | 
 | 
| 350 | 351 | - (void)setExclusionPaths:(NSArray *)exclusionPaths | 
| 351 | 352 | { | 
| 352 |  | -  if ((_exclusionPaths == nil && exclusionPaths != nil) || (![_exclusionPaths  isEqualToArray:exclusionPaths])) { | 
| 353 |  | -    _exclusionPaths = exclusionPaths; | 
| 354 |  | -    [self _invalidateRenderer]; | 
| 355 |  | -    [self invalidateCalculatedLayout]; | 
| 356 |  | -    ASDisplayNodeRespectThreadAffinityOfNode(self, ^{ | 
| 357 |  | -      [self setNeedsDisplay]; | 
| 358 |  | -    }); | 
|  | 353 | +  if (ASObjectIsEqual(exclusionPaths, _exclusionPaths)) { | 
|  | 354 | +    return; | 
| 359 | 355 |   } | 
|  | 356 | +   | 
|  | 357 | +  _exclusionPaths = [exclusionPaths copy]; | 
|  | 358 | +  [self _invalidateRenderer]; | 
|  | 359 | +  [self invalidateCalculatedLayout]; | 
|  | 360 | +  ASDisplayNodeRespectThreadAffinityOfNode(self, ^{ | 
|  | 361 | +    [self setNeedsDisplay]; | 
|  | 362 | +  }); | 
| 360 | 363 | } | 
| 361 | 364 | 
 | 
| 362 | 365 | - (NSArray *)exclusionPaths | 
| @@ -965,28 +968,22 @@ - (UIEdgeInsets)shadowPadding | 
| 965 | 968 | 
 | 
| 966 | 969 | - (void)setTruncationAttributedString:(NSAttributedString *)truncationAttributedString | 
| 967 | 970 | { | 
| 968 |  | -  // No-op if they're exactly equal (avoid redrawing) | 
| 969 |  | -  if (_truncationAttributedString == truncationAttributedString) { | 
|  | 971 | +  if (ASObjectIsEqual(_truncationAttributedString, truncationAttributedString)) { | 
| 970 | 972 |     return; | 
| 971 | 973 |   } | 
| 972 | 974 | 
 | 
| 973 |  | -  if (![_truncationAttributedString isEqual:truncationAttributedString]) { | 
| 974 |  | -    _truncationAttributedString = [truncationAttributedString copy]; | 
| 975 |  | -    [self _invalidateTruncationString]; | 
| 976 |  | -  } | 
|  | 975 | +  _truncationAttributedString = [truncationAttributedString copy]; | 
|  | 976 | +  [self _invalidateTruncationString]; | 
| 977 | 977 | } | 
| 978 | 978 | 
 | 
| 979 | 979 | - (void)setAdditionalTruncationMessage:(NSAttributedString *)additionalTruncationMessage | 
| 980 | 980 | { | 
| 981 |  | -  // Short circuit if we're setting to nil (prevent redrawing when we don't need to) | 
| 982 |  | -  if (_additionalTruncationMessage == additionalTruncationMessage) { | 
|  | 981 | +  if (ASObjectIsEqual(_additionalTruncationMessage, additionalTruncationMessage)) { | 
| 983 | 982 |     return; | 
| 984 | 983 |   } | 
| 985 | 984 | 
 | 
| 986 |  | -  if (![_additionalTruncationMessage isEqual:additionalTruncationMessage]) { | 
| 987 |  | -    _additionalTruncationMessage = [additionalTruncationMessage copy]; | 
| 988 |  | -    [self _invalidateTruncationString]; | 
| 989 |  | -  } | 
|  | 985 | +  _additionalTruncationMessage = [additionalTruncationMessage copy]; | 
|  | 986 | +  [self _invalidateTruncationString]; | 
| 990 | 987 | } | 
| 991 | 988 | 
 | 
| 992 | 989 | - (void)setTruncationMode:(NSLineBreakMode)truncationMode | 
|  | 
0 commit comments