mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Coerce value to a string once in _.intersection and _.uniq.
Former-commit-id: 5cb0f0034c473ec62c3b342f45d22c0abe6c5fb3
This commit is contained in:
14
lodash.js
14
lodash.js
@@ -2918,9 +2918,10 @@
|
|||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
var value = array[index];
|
var value = array[index];
|
||||||
if (isLarge) {
|
if (isLarge) {
|
||||||
var inited = hasOwnProperty.call(cache[0], value + '')
|
var key = value + '';
|
||||||
? !(seen = cache[0][value])
|
var inited = hasOwnProperty.call(cache[0], key)
|
||||||
: (seen = cache[0][value] = []);
|
? !(seen = cache[0][key])
|
||||||
|
: (seen = cache[0][key] = []);
|
||||||
}
|
}
|
||||||
if (inited || indexOf(seen, value) < 0) {
|
if (inited || indexOf(seen, value) < 0) {
|
||||||
if (isLarge) {
|
if (isLarge) {
|
||||||
@@ -3233,9 +3234,10 @@
|
|||||||
computed = callback ? callback(value, index, array) : value;
|
computed = callback ? callback(value, index, array) : value;
|
||||||
|
|
||||||
if (isLarge) {
|
if (isLarge) {
|
||||||
var inited = hasOwnProperty.call(cache, computed + '')
|
var key = computed + '';
|
||||||
? !(seen = cache[computed])
|
var inited = hasOwnProperty.call(cache, key)
|
||||||
: (seen = cache[computed] = []);
|
? !(seen = cache[key])
|
||||||
|
: (seen = cache[key] = []);
|
||||||
}
|
}
|
||||||
if (isSorted
|
if (isSorted
|
||||||
? !index || seen[seen.length - 1] !== computed
|
? !index || seen[seen.length - 1] !== computed
|
||||||
|
|||||||
Reference in New Issue
Block a user