From: Jason Bedard Date: Fri, 3 May 2013 01:45:02 +0000 (-0700) Subject: Only call jQuery(this) when needed. Close gh-1260. X-Git-Tag: 2.0.1~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c9267ab078ad223eceb381fb45ab06a86baccfb0;p=jquery.git Only call jQuery(this) when needed. Close gh-1260. --- diff --git a/.mailmap b/.mailmap index eeafcc6fa..f51476829 100644 --- a/.mailmap +++ b/.mailmap @@ -33,6 +33,7 @@ Isaac Z. Schlueter Ismail Khair James Burke James Padolsey +Jason Bedard Jay Merrifield Jay Merrifield Jean Boussier diff --git a/AUTHORS.txt b/AUTHORS.txt index 9ce13edf2..580570fb2 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -167,3 +167,4 @@ Michał Gołębiowski Steven Benner Li Xudong Renato Oliveira dos Santos +Jason Bedard diff --git a/src/attributes.js b/src/attributes.js index 6cefd52ac..ace917e91 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -182,15 +182,14 @@ jQuery.fn.extend({ isFunction = jQuery.isFunction( value ); return this.each(function( i ) { - var val, - self = jQuery(this); + var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { - val = value.call( this, i, self.val() ); + val = value.call( this, i, jQuery( this ).val() ); } else { val = value; }