From c75c9a8ebb5d2483daa68bec799e0d770083a811 Mon Sep 17 00:00:00 2001 From: Amey Sakhadeo Date: Wed, 28 Aug 2013 22:24:55 +0530 Subject: [PATCH] Fix #14313: Optimize jQuery.merge for size. Close gh-1344. --- src/core.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core.js b/src/core.js index 6d5c747f4..82616eaa5 100644 --- a/src/core.js +++ b/src/core.js @@ -552,18 +552,14 @@ jQuery.extend({ }, merge: function( first, second ) { - var l = second.length, + var l = +second.length, i = first.length, j = 0; - if ( typeof l === "number" ) { + if ( l ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } } first.length = i; -- 2.39.5