Remove argument unrolling in LazyWrapper assignments.

This commit is contained in:
jdalton
2015-03-04 00:46:10 -08:00
parent 69e9c7d0be
commit ee456493c4

View File

@@ -11670,16 +11670,13 @@
retUnwrapped = /^(?:first|last)$/.test(methodName); retUnwrapped = /^(?:first|last)$/.test(methodName);
lodash.prototype[methodName] = function() { lodash.prototype[methodName] = function() {
var length = arguments.length, var args = arguments,
args = Array(length), length = args.length,
chainAll = this.__chain__, chainAll = this.__chain__,
value = this.__wrapped__, value = this.__wrapped__,
isHybrid = !!this.__actions__.length, isHybrid = !!this.__actions__.length,
isLazy = value instanceof LazyWrapper; isLazy = value instanceof LazyWrapper;
while (length--) {
args[length] = arguments[length];
}
if (isLazy && checkIteratee) { if (isLazy && checkIteratee) {
// avoid lazy use if the iteratee has a `length` other than `1` // avoid lazy use if the iteratee has a `length` other than `1`
var iteratee = args[0]; var iteratee = args[0];