mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Loop cleanup
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
parent
77d7f26452
commit
2c7b1b8502
@ -75,12 +75,9 @@ jQuery.fn.extend({
|
|||||||
remove: function( selector, keepData ) {
|
remove: function( selector, keepData ) {
|
||||||
var elem,
|
var elem,
|
||||||
elems = selector ? jQuery.filter( selector, this ) : this,
|
elems = selector ? jQuery.filter( selector, this ) : this,
|
||||||
i = 0,
|
i = 0;
|
||||||
l = elems.length;
|
|
||||||
|
|
||||||
for ( ; i < l; i++ ) {
|
|
||||||
elem = elems[ i ];
|
|
||||||
|
|
||||||
|
for ( ; (elem = elems[i]) != null; i++ ) {
|
||||||
if ( !keepData && elem.nodeType === 1 ) {
|
if ( !keepData && elem.nodeType === 1 ) {
|
||||||
jQuery.cleanData( getAll( elem ) );
|
jQuery.cleanData( getAll( elem ) );
|
||||||
}
|
}
|
||||||
@ -98,12 +95,9 @@ jQuery.fn.extend({
|
|||||||
|
|
||||||
empty: function() {
|
empty: function() {
|
||||||
var elem,
|
var elem,
|
||||||
i = 0,
|
i = 0;
|
||||||
l = this.length;
|
|
||||||
|
|
||||||
for ( ; i < l; i++ ) {
|
|
||||||
elem = this[ i ];
|
|
||||||
|
|
||||||
|
for ( ; (elem = this[i]) != null; i++ ) {
|
||||||
if ( elem.nodeType === 1 ) {
|
if ( elem.nodeType === 1 ) {
|
||||||
|
|
||||||
// Prevent memory leaks
|
// Prevent memory leaks
|
||||||
|
Loading…
Reference in New Issue
Block a user