speed: committing a failing experiment of concat vs slice
[jquery.git] / src / attributes.js
index 041bb29..93e0433 100644 (file)
@@ -100,15 +100,13 @@ jQuery.fn.extend({
                                return;
 
                        if ( jQuery.isArray(val) && /radio|checkbox/.test( this.type ) )
-                               this.checked = (jQuery.inArray(this.value, val) >= 0 ||
-                                       jQuery.inArray(this.name, val) >= 0);
+                               this.checked = jQuery.inArray(this.value || this.name, val) >= 0;
 
                        else if ( jQuery.nodeName( this, "select" ) ) {
                                var values = jQuery.makeArray(val);
 
                                jQuery( "option", this ).each(function(){
-                                       this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
-                                               jQuery.inArray( this.text, values ) >= 0);
+                                       this.selected = jQuery.inArray( this.value || this.text, values ) >= 0;
                                });
 
                                if ( !values.length )
@@ -192,7 +190,7 @@ jQuery.extend({
                if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
                        return undefined;
 
-               var notxml = !elem.tagName || !jQuery.isXMLDoc( elem ),
+               var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
                        // Whether we are setting (or getting)
                        set = value !== undefined;
 
@@ -200,7 +198,7 @@ jQuery.extend({
                name = notxml && jQuery.props[ name ] || name;
 
                // Only do all the following if this is a node (faster for style)
-               if ( elem.tagName ) {
+               if ( elem.nodeType === 1 ) {
 
                        // These attributes require special treatment
                        var special = /href|src|style/.test( name );