Skip to content

Commit

Permalink
Avoid an extra variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Apr 26, 2018
1 parent 9f1964c commit 21f72a0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,11 +893,9 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
// Initial render
changedBits = MAX_SIGNED_31_BIT_INT;
} else {
const canBailOnChildren =
canBailOnProps && oldProps.children === newProps.children;
if (oldProps.value === newProps.value) {
// No change. Bailout early if children are the same.
if (canBailOnChildren) {
if (oldProps.children === newProps.children && canBailOnProps) {
workInProgress.stateNode = 0;
pushProvider(workInProgress);
return bailoutOnAlreadyFinishedWork(current, workInProgress);
Expand All @@ -914,7 +912,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
(oldValue !== oldValue && newValue !== newValue) // eslint-disable-line no-self-compare
) {
// No change. Bailout early if children are the same.
if (canBailOnChildren) {
if (oldProps.children === newProps.children && canBailOnProps) {
workInProgress.stateNode = 0;
pushProvider(workInProgress);
return bailoutOnAlreadyFinishedWork(current, workInProgress);
Expand All @@ -937,7 +935,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(

if (changedBits === 0) {
// No change. Bailout early if children are the same.
if (canBailOnChildren) {
if (oldProps.children === newProps.children && canBailOnProps) {
workInProgress.stateNode = 0;
pushProvider(workInProgress);
return bailoutOnAlreadyFinishedWork(current, workInProgress);
Expand Down

0 comments on commit 21f72a0

Please sign in to comment.