Skip to content

Commit c45db4e

Browse files
committed
[Performance] use inline typeof
1 parent 92aaa51 commit c45db4e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ function getTestArgs(name_, opts_, cb_) {
3030

3131
for (var i = 0; i < arguments.length; i++) {
3232
var arg = arguments[i];
33-
var t = typeof arg;
34-
if (t === 'string') {
33+
if (typeof arg === 'string') {
3534
name = arg;
36-
} else if (t === 'object') {
35+
} else if (typeof arg === 'object') {
3736
opts = arg || opts;
38-
} else if (t === 'function') {
37+
} else if (typeof arg === 'function') {
3938
cb = arg;
4039
}
4140
}

0 commit comments

Comments
 (0)