From: Ariel Flesler Date: Fri, 16 May 2008 18:32:03 +0000 (+0000) Subject: jquery core: saving some bytes in $.fn.val by using $.makeArray. X-Git-Tag: 1.2.4~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3a7b09e5c747a9bf1386d667c7abed9630097072;p=jquery.git jquery core: saving some bytes in $.fn.val by using $.makeArray. --- diff --git a/src/core.js b/src/core.js index 27cdbfe1f..56a2b1f1c 100644 --- a/src/core.js +++ b/src/core.js @@ -410,9 +410,7 @@ jQuery.fn = jQuery.prototype = { jQuery.inArray(this.name, value) >= 0); else if ( jQuery.nodeName( this, "select" ) ) { - var values = value.constructor == Array ? - value : - [ value ]; + var values = jQuery.makeArray(value); jQuery( "option", this ).each(function(){ this.selected = (jQuery.inArray( this.value, values ) >= 0 ||