Small optimization to jQuery.prop, saving 2 or 3 bytes
[jquery.git] / src / jquery / jquery.js
index 76f11d7..004d634 100644 (file)
@@ -38,7 +38,7 @@ var jQuery = function(a,c) {
        // Handle HTML strings
        if ( typeof a  == "string" ) {
                // HANDLE: $(html) -> $(array)
-               var m = /^[^<]*(<(.|\n)+>)[^>]*$/.exec(a);
+               var m = /^[^<]*(<(.|\s)+>)[^>]*$/.exec(a);
                if ( m )
                        a = jQuery.clean( [ m[1] ] );
                
@@ -1281,10 +1281,9 @@ jQuery.extend({
                        var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
 
                        // Handle passing in a number to a CSS property
-                       if ( value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
-                               return value + "px";
-
-                       return value;
+                       return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
+                               value + "px" :
+                               value;
        },
 
        className: {