Avoid iterating strings in _.merge. [closes #978]

This commit is contained in:
jdalton
2015-02-18 21:05:39 -08:00
parent 9734fd0353
commit 153fe61b4b

View File

@@ -2548,8 +2548,10 @@
* @returns {Object} Returns the destination object.
*/
function baseMerge(object, source, customizer, stackA, stackB) {
if (!isObjectLike(object)) {
return object;
}
var isSrcArr = isLength(source.length) && (isArray(source) || isTypedArray(source));
(isSrcArr ? arrayEach : baseForOwn)(source, function(srcValue, key, source) {
if (isObjectLike(srcValue)) {
stackA || (stackA = []);