Skip to content

Commit

Permalink
Revert "Extra log for case where availableHeight is undefined and siz…
Browse files Browse the repository at this point in the history
…ing mode != max content (#1687)" (#1741)

Summary:
Pull Request resolved: #1741

X-link: facebook/react-native#47581

Reverting #1687 as it appears to regress Yoga performance anywhere from 10-33%.

## Changelog

[Internal]

Reviewed By: rshest

Differential Revision: D65863569

fbshipit-source-id: e6992e05dd59ba75548a5d633cb7f5c3fa99a6e4
  • Loading branch information
rozele authored and facebook-github-bot committed Nov 13, 2024
1 parent 8f69ac7 commit 5b962c0
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions yoga/algorithm/CalculateLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <cfloat>
#include <cmath>
#include <cstring>
#include <string>

#include <yoga/Yoga.h>

Expand Down Expand Up @@ -693,13 +692,6 @@ static float distributeFreeSpaceSecondPass(
}
}

yoga::assertFatalWithNode(
currentLineChild,
yoga::isDefined(updatedMainSize),
("updatedMainSize is undefined. mainAxisOwnerSize: " +
std::to_string(mainAxisOwnerSize))
.c_str());

deltaFreeSpace += updatedMainSize - childFlexBasis;

const float marginMain = currentLineChild->style().computeMarginForAxis(
Expand Down Expand Up @@ -793,20 +785,6 @@ static float distributeFreeSpaceSecondPass(
const bool isLayoutPass = performLayout && !requiresStretchLayout;
// Recursively call the layout algorithm for this child with the updated
// main size.

yoga::assertFatalWithNode(
currentLineChild,
yoga::isUndefined(childMainSize)
? childMainSizingMode == SizingMode::MaxContent
: true,
"childMainSize is undefined so childMainSizingMode must be MaxContent");
yoga::assertFatalWithNode(
currentLineChild,
yoga::isUndefined(childCrossSize)
? childCrossSizingMode == SizingMode::MaxContent
: true,
"childCrossSize is undefined so childCrossSizingMode must be MaxContent");

calculateLayoutInternal(
currentLineChild,
childWidth,
Expand Down

0 comments on commit 5b962c0

Please sign in to comment.