Skip to content

Commit

Permalink
[Performance] use inline typeof
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 21, 2023
1 parent 92aaa51 commit c45db4e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/test.js
Expand Up @@ -30,12 +30,11 @@ function getTestArgs(name_, opts_, cb_) {

for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
var t = typeof arg;
if (t === 'string') {
if (typeof arg === 'string') {
name = arg;
} else if (t === 'object') {
} else if (typeof arg === 'object') {
opts = arg || opts;
} else if (t === 'function') {
} else if (typeof arg === 'function') {
cb = arg;
}
}
Expand Down

0 comments on commit c45db4e

Please sign in to comment.