Ensure _.intersection of a single array returns an empty array. [closes #1085]

This commit is contained in:
jdalton
2015-03-26 13:17:41 -07:00
parent 075cae4efb
commit 2884f8acb8
2 changed files with 13 additions and 10 deletions

View File

@@ -5094,7 +5094,8 @@
argsLength = arguments.length,
caches = [],
indexOf = getIndexOf(),
isCommon = indexOf == baseIndexOf;
isCommon = indexOf == baseIndexOf,
result = [];
while (++argsIndex < argsLength) {
var value = arguments[argsIndex];
@@ -5104,10 +5105,12 @@
}
}
argsLength = args.length;
if (argsLength < 2) {
return result;
}
var array = args[0],
index = -1,
length = array ? array.length : 0,
result = [],
seen = caches[0];
outer: