Skip to content

Commit 849ce41

Browse files
ericandersontimdorr
authored andcommitted
Minor optimization: remove conditional (#1131)
* Minor optimization: remove conditional The conditional in selectDerivedProps is unnecessary. The code behaves identically now but saves about 10% of performance for that portion of the function. See: https://jsperf.com/conditional-vs-not Code left in place but commented in case someone ever wants to add something like it back for "clarity". * Just remove the code
1 parent f2ac4cc commit 849ce41

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/components/connectAdvanced.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ export default function connectAdvanced(
151151

152152
const nextProps = sourceSelector(state, props)
153153

154-
if (lastDerivedProps === nextProps) {
155-
return lastDerivedProps
156-
}
157-
158154
lastDerivedProps = nextProps
159155
return lastDerivedProps
160156
}

0 commit comments

Comments
 (0)