Simplify lazyValue.

This commit is contained in:
John-David Dalton
2014-10-09 00:13:33 -07:00
parent 30fc97eef6
commit ec3e3ed1fd

View File

@@ -4766,11 +4766,8 @@
* @returns {*} Returns the unwrapped value. * @returns {*} Returns the unwrapped value.
*/ */
function lazyValue() { function lazyValue() {
var array = this.wrapped; var array = this.wrapped.value(),
if (array instanceof LodashWrapper || array instanceof LazyWrapper) { length = array.length,
array = array.value();
}
var length = array.length,
start = 0, start = 0,
end = length, end = length,
views = this.views, views = this.views,
@@ -9936,7 +9933,7 @@
}); });
// add `LazyWrapper` methods for `_.drop` and `_.take` variants // add `LazyWrapper` methods for `_.drop` and `_.take` variants
arrayEach(['drop', 'take'], function(methodName, index) { arrayEach(['drop', 'take'], function(methodName) {
var countName = methodName + 'Count', var countName = methodName + 'Count',
whileName = methodName + 'While'; whileName = methodName + 'While';