diff options
author | Ariel Flesler <aflesler@gmail.com> | 2008-05-13 02:20:08 +0000 |
---|---|---|
committer | Ariel Flesler <aflesler@gmail.com> | 2008-05-13 02:20:08 +0000 |
commit | 28182b43209b0e62b9ca2192671fc26644953717 (patch) | |
tree | dcddb023f734f0bd7b1c551f66d683faf1deb9d8 | |
parent | 3f5ff3097c315456fe92c9b1e4578590e1eb8648 (diff) | |
download | jquery-28182b43209b0e62b9ca2192671fc26644953717.tar.gz jquery-28182b43209b0e62b9ca2192671fc26644953717.zip |
Closes #2510
-rw-r--r-- | src/core.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core.js b/src/core.js index a0533b178..8743f05c4 100644 --- a/src/core.js +++ b/src/core.js @@ -1146,17 +1146,17 @@ jQuery.extend({ merge: function( first, second ) { // We have to loop this way because IE & Opera overwrite the length // expando of getElementsByTagName - var i = 0; + var i = 0, elem, pos = first.length; // Also, we need to make sure that the correct elements are being returned // (IE returns comment nodes in a '*' query) if ( jQuery.browser.msie ) { - for ( ; second[ i ]; i++ ) - if ( second[ i ].nodeType != 8 ) - first.push( second[ i ] ); + while ( elem = second[ i++ ] ) + if ( elem.nodeType != 8 ) + first[ pos++ ] = elem; } else - for ( ; second[ i ]; i++ ) - first.push( second[ i ] ); + while ( elem = second[ i++ ] ) + first[ pos++ ] = elem; return first; }, |