Skip to content
Permalink
Browse files

Loop cleanup

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information...
rwaldron committed Apr 17, 2013
1 parent 77d7f26 commit 2c7b1b8502ba85320678499c8499b647c1ea82e2
Showing with 4 additions and 10 deletions.
  1. +4 −10 src/manipulation.js
@@ -75,12 +75,9 @@ jQuery.fn.extend({
remove: function( selector, keepData ) {
var elem,
elems = selector ? jQuery.filter( selector, this ) : this,
i = 0,
l = elems.length;

for ( ; i < l; i++ ) {
elem = elems[ i ];
i = 0;

for ( ; (elem = elems[i]) != null; i++ ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem ) );
}
@@ -98,12 +95,9 @@ jQuery.fn.extend({

empty: function() {
var elem,
i = 0,
l = this.length;

for ( ; i < l; i++ ) {
elem = this[ i ];
i = 0;

for ( ; (elem = this[i]) != null; i++ ) {
if ( elem.nodeType === 1 ) {

// Prevent memory leaks

0 comments on commit 2c7b1b8

Please sign in to comment.
You can’t perform that action at this time.