mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Add length check to avoid extra work in initArrayClone.
This commit is contained in:
@@ -2849,7 +2849,7 @@
|
||||
}
|
||||
}
|
||||
// add array properties assigned by `RegExp#exec`
|
||||
if (typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
||||
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
||||
result.index = array.index;
|
||||
result.input = array.input;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user