aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2013-04-16 22:37:48 -0400
committerRick Waldron <waldron.rick@gmail.com>2013-04-16 22:37:48 -0400
commit2c7b1b8502ba85320678499c8499b647c1ea82e2 (patch)
treed7390caf8d0682fe3f02f1b6d9cdecb10ff05aff /src/manipulation.js
parent77d7f264524677104cd7f37ecdb631d5824eacd4 (diff)
downloadjquery-2c7b1b8502ba85320678499c8499b647c1ea82e2.tar.gz
jquery-2c7b1b8502ba85320678499c8499b647c1ea82e2.zip
Loop cleanup
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index ac1bf2bbf..640dfcd6f 100644
--- a/src/manipulation.js
+++ b/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