]> source.dussan.org Git - jquery.git/commitdiff
Fix #14313: Optimize jQuery.merge for size. Close gh-1344.
authorAmey Sakhadeo <me@ameyms.com>
Wed, 28 Aug 2013 16:54:55 +0000 (22:24 +0530)
committerRichard Gibson <richard.gibson@gmail.com>
Fri, 30 Aug 2013 23:55:03 +0000 (19:55 -0400)
src/core.js

index 6d5c747f42fa0c0900778e5fb582563e1e2174b3..82616eaa57cd4f7ba4e661864ced6cf7ff81074c 100644 (file)
@@ -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;