Skip to content

Introduce isDefined() and remove cases of !isUndefined()#41209

Closed
joevilches wants to merge 2 commits into
facebook:mainfrom
joevilches:export-D50705523
Closed

Introduce isDefined() and remove cases of !isUndefined()#41209
joevilches wants to merge 2 commits into
facebook:mainfrom
joevilches:export-D50705523

Conversation

@joevilches
Copy link
Copy Markdown
Contributor

Summary:
There are so many instances in this code base where we use the double negative of !yoga::isUndefined(<something>). This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like !longVariableName.longFunctionName(longArgumentName).isUndefined() and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted isUndefined() with isDefined() so its easier to read.

Differential Revision: D50705523

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Oct 26, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Oct 26, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,634,467 +156
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,018,212 +165
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: d11d5f3
Branch: main

joevilches pushed a commit to joevilches/yoga that referenced this pull request Oct 27, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Differential Revision: D50705523
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

joevilches pushed a commit to joevilches/yoga that referenced this pull request Nov 2, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

1 similar comment
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

joevilches pushed a commit to joevilches/yoga that referenced this pull request Nov 3, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
NickGerleman pushed a commit to NickGerleman/yoga that referenced this pull request Nov 3, 2023
Summary:
X-link: facebook/react-native#41209

Pull Request resolved: facebook#1439

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523

fbshipit-source-id: 458ca7567d440b8f795a82c45fccd2043df4f790
joevilches pushed a commit to joevilches/yoga that referenced this pull request Nov 6, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
joevilches pushed a commit to joevilches/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

joevilches pushed a commit to joevilches/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

NickGerleman pushed a commit to NickGerleman/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209

Pull Request resolved: facebook#1439

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523

fbshipit-source-id: 4bd43c0a0910aca15e082d64c0843823a5de853f
NickGerleman pushed a commit to NickGerleman/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209

Pull Request resolved: facebook#1439

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523

fbshipit-source-id: 5fc2608c2200f2db5ee28e424900375a3c4c239d
joevilches pushed a commit to joevilches/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

NickGerleman pushed a commit to NickGerleman/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209

Pull Request resolved: facebook#1439

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523

fbshipit-source-id: df31c5ec14c32cb239c1953912cc30edec6b3b33
Joe Vilches added 2 commits November 7, 2023 03:23
…ok#41208)

Summary:
X-link: facebook/yoga#1437


Reading through the sizing logic and this seemed a bit redundant/confusing. Lets use the same function we just used for the main axis for the cross axis as well so people do not think its special. Also we will need one less variable. The reason this was done it seems is because we need the leading padding + border elsewhere so this is technically a few less steps but this is cleaner

Reviewed By: NickGerleman

Differential Revision: D50704177
)

Summary:

X-link: facebook/yoga#1439

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
joevilches pushed a commit to joevilches/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209


There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D50705523

facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209

X-link: facebook/yoga#1439

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523

fbshipit-source-id: edc7d3f2cbbae38ddaeb2030a419320caf73feff
facebook-github-bot pushed a commit to facebook/yoga that referenced this pull request Nov 7, 2023
Summary:
X-link: facebook/react-native#41209

Pull Request resolved: #1439

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523

fbshipit-source-id: edc7d3f2cbbae38ddaeb2030a419320caf73feff
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Nov 7, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 3b13d3c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants