From d1d1be49ba5a32072d172f73a45b66a0f5ad197a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 21 Oct 2014 08:04:29 -0700 Subject: [PATCH] Reduce lazy wrapper for lazy `first` and `last`. --- lodash.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lodash.js b/lodash.js index 87de9ce38..d00d60a7e 100644 --- a/lodash.js +++ b/lodash.js @@ -10095,12 +10095,9 @@ isLazy = value instanceof LazyWrapper; if (retUnwrapped && !chainAll) { - if (isLazy) { - return func.apply(value, args); - } - var otherArgs = [this.value()]; - push.apply(otherArgs, args); - return lodash[methodName].apply(lodash, otherArgs); + return isLazy + ? func.call(value) + : lodash[methodName](this.value()); } if (isLazy || isArray(value)) { var result = func.apply(isLazy ? value : new LazyWrapper(this), args);