Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
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 ) );
}
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