mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Add fast path for callback back to _.forEach and ensure createCallback is called from lodash.
Former-commit-id: 5d589344897878d529d59ebba987a163b9704b37
This commit is contained in:
6
build.js
6
build.js
@@ -1830,7 +1830,7 @@
|
||||
' length = collection ? collection.length : 0;',
|
||||
'',
|
||||
" if (typeof length == 'number') {",
|
||||
' callback = createCallback(callback, thisArg);',
|
||||
" callback = callback && typeof thisArg == 'undefined' ? callback : lodash.createCallback(callback, thisArg);",
|
||||
' while (++index < length) {',
|
||||
' if (callback(collection[index], index, collection) === false) {',
|
||||
' break;',
|
||||
@@ -1849,7 +1849,7 @@
|
||||
' var index = -1,',
|
||||
' length = collection ? collection.length : 0;',
|
||||
'',
|
||||
' callback = createCallback(callback, thisArg);',
|
||||
' callback = lodash.createCallback(callback, thisArg);',
|
||||
" if (typeof length == 'number') {",
|
||||
' var result = Array(length);',
|
||||
' while (++index < length) {',
|
||||
@@ -2285,7 +2285,7 @@
|
||||
' }',
|
||||
' if (callback != null) {',
|
||||
' seen = [];',
|
||||
' callback = createCallback(callback, thisArg);',
|
||||
' callback = lodash.createCallback(callback, thisArg);',
|
||||
' }',
|
||||
' while (++index < length) {',
|
||||
' var value = array[index],',
|
||||
|
||||
Reference in New Issue
Block a user