Skip to content

Commit 9d7290f

Browse files
committed
Move NODE_ENV check up so debug checks are eliminated from prod
1 parent 9f133f9 commit 9d7290f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/createSelectorCreator.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,10 @@ export function createSelectorCreator<
386386
arguments
387387
)
388388

389-
if (shouldRunInputStabilityCheck(inputStabilityCheck, firstRun)) {
389+
if (
390+
process.env.NODE_ENV !== 'production' &&
391+
shouldRunInputStabilityCheck(inputStabilityCheck, firstRun)
392+
) {
390393
// make a second copy of the params, to check if we got the same results
391394
const inputSelectorResultsCopy = collectInputSelectorResults(
392395
dependencies,

src/utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ export const shouldRunInputStabilityCheck = (
144144
firstRun: boolean
145145
) => {
146146
return (
147-
process.env.NODE_ENV !== 'production' &&
148-
(inputStabilityCheck === 'always' ||
149-
(inputStabilityCheck === 'once' && firstRun))
147+
inputStabilityCheck === 'always' ||
148+
(inputStabilityCheck === 'once' && firstRun)
150149
)
151150
}
152-

0 commit comments

Comments
 (0)