Skip to content

Commit

Permalink
Small NaN related optimisation in RCTShadowText
Browse files Browse the repository at this point in the history
Summary: NaN values can not be compared directly, so we have to use `isnan` function.

Reviewed By: mmmulani

Differential Revision: D5859761

fbshipit-source-id: bf99a1ae574cd820265bef0c2bd255b194c5dc3c
  • Loading branch information
shergin authored and facebook-github-bot committed Sep 26, 2017
1 parent 3649fce commit 73b596c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Text/RCTShadowText.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ - (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(YGMeasureM
{
if (
_cachedTextStorage &&
width == _cachedTextStorageWidth &&
(width == _cachedTextStorageWidth || (isnan(width) && isnan(_cachedTextStorageWidth))) &&
widthMode == _cachedTextStorageWidthMode &&
_cachedEffectiveLayoutDirection == self.effectiveLayoutDirection
) {
Expand Down

0 comments on commit 73b596c

Please sign in to comment.