mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #14313: Optimize jQuery.merge for size. Close gh-1344.
This commit is contained in:
parent
83396ba832
commit
c75c9a8ebb
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user