Add fast path for callback back to _.forEach and ensure createCallback is called from lodash.

Former-commit-id: 5d589344897878d529d59ebba987a163b9704b37
This commit is contained in:
John-David Dalton
2013-03-15 06:34:13 -07:00
parent 63052257a2
commit e941de50e8
5 changed files with 43 additions and 43 deletions

View File

@@ -1733,7 +1733,7 @@
length = collection ? collection.length : 0;
if (typeof length == 'number') {
callback = createCallback(callback, thisArg);
callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg);
while (++index < length) {
if (callback(collection[index], index, collection) === indicatorObject) {
break;