aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2012-06-28 04:55:36 +0400
committerDave Methvin <dave.methvin@gmail.com>2012-07-06 09:48:52 -0400
commit05aff402310d7db5d15f96b15071af6aa21a2afc (patch)
tree7c4dba23c514ce8a4562969793c48ae3e05a6df3 /src/core.js
parentf8baea8f7a8b23d0e25c0dc82670fbe48b9bf587 (diff)
downloadjquery-05aff402310d7db5d15f96b15071af6aa21a2afc.tar.gz
jquery-05aff402310d7db5d15f96b15071af6aa21a2afc.zip
Optimization of array operations, closes gh-844.
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core.js b/src/core.js
index 9a506f31e..c92774075 100644
--- a/src/core.js
+++ b/src/core.js
@@ -197,15 +197,9 @@ jQuery.fn = jQuery.prototype = {
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = this.constructor();
-
- if ( jQuery.isArray( elems ) ) {
- core_push.apply( ret, elems );
- } else {
- jQuery.merge( ret, elems );
- }
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;