-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix measure inner dimensions #1114
Fix measure inner dimensions #1114
Conversation
yoga/Yoga.cpp
Outdated
collectedFlexItemsValues.totalFlexGrowFactors) || | ||
collectedFlexItemsValues.totalFlexGrowFactors == 0) || | ||
(YGFloatIsUndefined(node->resolveFlexGrow()) && | ||
(YGFloatIsUndefined(node->resolveFlexGrow()) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess those extra parentheses are redundant, now that it's a list of OR clauses... granted, the expression is quite hard to unpack visually, and extra parentheses don't help here, quite an opposite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually believe that the original intent there may have been to have it like this instead:
if (!node->getConfig()->useLegacyStretchBehaviour &&
((!YGFloatIsUndefined(
collectedFlexItemsValues.totalFlexGrowFactors) &&
collectedFlexItemsValues.totalFlexGrowFactors == 0) ||
(!YGFloatIsUndefined(node->resolveFlexGrow()) &&
node->resolveFlexGrow() == 0))) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right. I had update this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my comment, the code was wrong there, but I believe the intent was to check if not undefined and then compare with zero for both values.
6be2fbf
to
9f85924
Compare
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: `YGFloatIsUndefined(collectedFlexItemsValues.totalFlexGrowFactors) && collectedFlexItemsValues.totalFlexGrowFactors == 0` is not reachable. X-link: facebook/yoga#1114 Reviewed By: NickGerleman Differential Revision: D40203817 Pulled By: NickGerleman fbshipit-source-id: 46a8c19dc0e097f4c28e7f48135f0382a557764a
Summary: `YGFloatIsUndefined(collectedFlexItemsValues.totalFlexGrowFactors) && collectedFlexItemsValues.totalFlexGrowFactors == 0` is not reachable. X-link: facebook/yoga#1114 Reviewed By: NickGerleman Differential Revision: D40203817 Pulled By: NickGerleman fbshipit-source-id: 46a8c19dc0e097f4c28e7f48135f0382a557764a
Summary: `YGFloatIsUndefined(collectedFlexItemsValues.totalFlexGrowFactors) && collectedFlexItemsValues.totalFlexGrowFactors == 0` is not reachable. X-link: facebook/yoga#1114 Reviewed By: NickGerleman Differential Revision: D40203817 Pulled By: NickGerleman fbshipit-source-id: 46a8c19dc0e097f4c28e7f48135f0382a557764a
YGFloatIsUndefined(collectedFlexItemsValues.totalFlexGrowFactors) && collectedFlexItemsValues.totalFlexGrowFactors == 0
is not reachable.