Skip to content

Commit 3a7b09e

Browse files
committed
jquery core: saving some bytes in $.fn.val by using $.makeArray.
1 parent da76a72 commit 3a7b09e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/core.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,7 @@ jQuery.fn = jQuery.prototype = {
410410
jQuery.inArray(this.name, value) >= 0);
411411

412412
else if ( jQuery.nodeName( this, "select" ) ) {
413-
var values = value.constructor == Array ?
414-
value :
415-
[ value ];
413+
var values = jQuery.makeArray(value);
416414

417415
jQuery( "option", this ).each(function(){
418416
this.selected = (jQuery.inArray( this.value, values ) >= 0 ||

0 commit comments

Comments
 (0)