X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=5ffccc5b6c290a879d5c090afce499f7ec006a9e;hb=f0353e89abf6643e5a88a649887a71a9ebd973d9;hp=ff33034ede6ff512a4f6aac2e796bb891ef06b34;hpb=2b05e24993c48f3b9c2cb9857090dc4b218b8834;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index ff33034..5ffccc5 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1394,9 +1394,15 @@ jQuery.extend({ if ( obj.length == undefined ) for ( var i in obj ) fn.apply( obj[i], args || [i, obj[i]] ); - else + else if ( args ) { for ( var i = 0, ol = obj.length; i < ol; i++ ) - if ( fn.apply( obj[i], args || [i, obj[i]] ) === false ) break; + if ( fn.apply( obj[i], args ) === false ) break; + + // A special, fast, case for the most common use of each + } else + for ( var i = 0, ol = obj.length, val = obj[0]; + i < ol && fn.call(val,i,val) !== false; val = obj[++i] ); + return obj; },