From fd0f42bf5cf18d311db78680e4d28bc6ff1b016c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Sat, 3 Feb 2007 19:32:16 +0000 Subject: [PATCH 1/1] Small optimization to jQuery.prop, saving 2 or 3 bytes --- src/jquery/jquery.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index e2a2a22..004d634 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -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: { -- 1.7.10.4