Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 32b7f46

Browse files
committed
Avoid baseAry use when possible.
1 parent f1687f9 commit 32b7f46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

convert.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ function convert(name, func) {
4141
length = Math.min(args.length, n);
4242

4343
switch (length) {
44-
case 0: return func();
4544
case 1: return func(args[0]);
4645
case 2: return func(args[0], args[1]);
46+
case 0: return func();
4747
}
4848
args = Array(length);
4949
while (length--) {
@@ -57,7 +57,8 @@ function convert(name, func) {
5757
'callback': function(callback) {
5858
return function(func, thisArg, argCount) {
5959
argCount = argCount > 2 ? (argCount - 2) : 1;
60-
return baseAry(callback(func, thisArg), argCount);
60+
func = callback(func, thisArg);
61+
return func.length <= argCount ? func : baseAry(func, argCount);
6162
};
6263
},
6364
'runInContext': function(runInContext) {

0 commit comments

Comments
 (0)