Skip to content

Commit

Permalink
Only call jQuery(this) when needed. Close gh-1260.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard authored and dmethvin committed May 9, 2013
1 parent 47f56f1 commit c9267ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Isaac Z. Schlueter <i@izs.me>
Ismail Khair <ismail.khair@gmail.com>
James Burke <jrburke@gmail.com>
James Padolsey <cla@padolsey.net> <jamespadolsey@gmail.com>
Jason Bedard <jason+jquery@jbedard.ca> <github@jbedard.ca>
Jay Merrifield <fracmak@gmail.com>
Jay Merrifield <fracmak@gmail.com> <jmerrifiel@gannett.com>
Jean Boussier <jean.boussier@gmail.com>
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,4 @@ Michał Gołębiowski <m.goleb@gmail.com>
Steven Benner <admin@stevenbenner.com>
Li Xudong <istonelee@gmail.com>
Renato Oliveira dos Santos <ros3@cin.ufpe.br>
Jason Bedard <jason+jquery@jbedard.ca>
5 changes: 2 additions & 3 deletions src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c9267ab

Please sign in to comment.