mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Remove array length limit for lay evaluation. [closes #2874]
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -1567,9 +1567,9 @@
|
|||||||
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
|
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
|
||||||
* the creation of intermediate arrays and can greatly reduce the number of
|
* the creation of intermediate arrays and can greatly reduce the number of
|
||||||
* iteratee executions. Sections of a chain sequence qualify for shortcut
|
* iteratee executions. Sections of a chain sequence qualify for shortcut
|
||||||
* fusion if the section is applied to an array of at least `200` elements
|
* fusion if the section is applied to an array and iteratees accept only
|
||||||
* and any iteratees accept only one argument. The heuristic for whether a
|
* one argument. The heuristic for whether a section qualifies for shortcut
|
||||||
* section qualifies for shortcut fusion is subject to change.
|
* fusion is subject to change.
|
||||||
*
|
*
|
||||||
* Chaining is supported in custom builds as long as the `_#value` method is
|
* Chaining is supported in custom builds as long as the `_#value` method is
|
||||||
* directly or indirectly included in the build.
|
* directly or indirectly included in the build.
|
||||||
@@ -1876,8 +1876,7 @@
|
|||||||
resIndex = 0,
|
resIndex = 0,
|
||||||
takeCount = nativeMin(length, this.__takeCount__);
|
takeCount = nativeMin(length, this.__takeCount__);
|
||||||
|
|
||||||
if (!isArr || arrLength < LARGE_ARRAY_SIZE ||
|
if (!isArr || (arrLength == length && takeCount == length)) {
|
||||||
(arrLength == length && takeCount == length)) {
|
|
||||||
return baseWrapperValue(array, this.__actions__);
|
return baseWrapperValue(array, this.__actions__);
|
||||||
}
|
}
|
||||||
var result = [];
|
var result = [];
|
||||||
@@ -5148,8 +5147,7 @@
|
|||||||
var args = arguments,
|
var args = arguments,
|
||||||
value = args[0];
|
value = args[0];
|
||||||
|
|
||||||
if (wrapper && args.length == 1 &&
|
if (wrapper && args.length == 1 && isArray(value)) {
|
||||||
isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
|
|
||||||
return wrapper.plant(value).value();
|
return wrapper.plant(value).value();
|
||||||
}
|
}
|
||||||
var index = 0,
|
var index = 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user