mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +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`
|
// 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.index = array.index;
|
||||||
result.input = array.input;
|
result.input = array.input;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user