aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel Flesler <aflesler@gmail.com>2008-05-16 18:32:03 +0000
committerAriel Flesler <aflesler@gmail.com>2008-05-16 18:32:03 +0000
commit3a7b09e5c747a9bf1386d667c7abed9630097072 (patch)
tree1150f81e0adcd86013c87e423c63c877ba30bbf7
parentda76a723e14c037d59e830bb0d01b0b627286020 (diff)
downloadjquery-3a7b09e5c747a9bf1386d667c7abed9630097072.tar.gz
jquery-3a7b09e5c747a9bf1386d667c7abed9630097072.zip
jquery core: saving some bytes in $.fn.val by using $.makeArray.
-rw-r--r--src/core.js4
1 files changed, 1 insertions, 3 deletions
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 ||