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 4e2db4d commit 5ba89c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,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 5ba89c9

Please sign in to comment.