A speedup for .remove() (which also speeds up .html()). Fixes #4178.
[jquery.git] / src / core.js
index e0428c4..c7d10f3 100644 (file)
@@ -267,8 +267,10 @@ jQuery.fn = jQuery.prototype = {
        },
 
        // For internal use only.
-       // Behaves like an Array's .push method, not like a jQuery method.
+       // Behaves like an Array's method, not like a jQuery method.
        push: [].push,
+       sort: [].sort,
+       splice: [].splice,
 
        find: function( selector ) {
                if ( this.length === 1 ) {
@@ -1232,7 +1234,7 @@ jQuery.each({
 
        empty: function() {
                // Remove element nodes and prevent memory leaks
-               jQuery( ">*", this ).remove();
+               jQuery(this).children().remove();
 
                // Remove any remaining nodes
                while ( this.firstChild )