-
Notifications
You must be signed in to change notification settings - Fork 45.7k
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
Remove redundant conditional statements #18627
Conversation
Since it will continue when the props are equal in line 767, there is no need to compare whether they are not equal.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ae788c4:
|
@@ -824,10 +824,7 @@ export function diffProperties( | |||
// inserted already. | |||
} | |||
} else if (propKey === CHILDREN) { | |||
if ( | |||
lastProp !== nextProp && |
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.
This change seems nice, since we already check for this above
nextProp === lastProp || |
@@ -405,12 +405,11 @@ function ChildReconciler(shouldTrackSideEffects) { | |||
); | |||
created.return = returnFiber; | |||
return created; | |||
} else { |
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.
This change is subjective and I think should be reverted.
@@ -405,12 +405,11 @@ function ChildReconciler(shouldTrackSideEffects) { | |||
); | |||
created.return = returnFiber; | |||
return created; | |||
} else { |
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.
Ditto.
Summary
Remove redundant conditional statements