Reviewed by Mitz.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Feb 2007 16:25:43 +0000 (16:25 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Feb 2007 16:25:43 +0000 (16:25 +0000)
        - 2% speedup on BenchJS test 6

        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::cssText): Use format() instead of
        number() followed by append of a constant string.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19827 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/css/CSSPrimitiveValue.cpp

index 7ed8f665d46f2ef35bf45c25e7247df65975d70d..30cc2664865e20f88cef10a3bd1fede9c8270f72 100644 (file)
@@ -1,3 +1,13 @@
+2007-02-23  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Mitz.
+
+        - 2% speedup on BenchJS test 6
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::cssText): Use format() instead of
+        number() followed by append of a constant string.
+
 2007-02-22  George Staikos  <staikos@kde.org>
 
         Fix the Qt build.
index 4c4d2a615a8f49057daa65ffcec66525be36885a..8eb4efed16c41e764e6e8a33d68dcc516f9524b2 100644 (file)
@@ -454,52 +454,52 @@ String CSSPrimitiveValue::cssText() const
             text = String::number(m_value.num);
             break;
         case CSS_PERCENTAGE:
-            text = String::number(m_value.num) + "%";
+            text = String::format("%.6lg%%", m_value.num);
             break;
         case CSS_EMS:
-            text = String::number(m_value.num) + "em";
+            text = String::format("%.6lgem", m_value.num);
             break;
         case CSS_EXS:
-            text = String::number(m_value.num) + "ex";
+            text = String::format("%.6lgex", m_value.num);
             break;
         case CSS_PX:
-            text = String::number(m_value.num) + "px";
+            text = String::format("%.6lgpx", m_value.num);
             break;
         case CSS_CM:
-            text = String::number(m_value.num) + "cm";
+            text = String::format("%.6lgcm", m_value.num);
             break;
         case CSS_MM:
-            text = String::number(m_value.num) + "mm";
+            text = String::format("%.6lgmm", m_value.num);
             break;
         case CSS_IN:
-            text = String::number(m_value.num) + "in";
+            text = String::format("%.6lgin", m_value.num);
             break;
         case CSS_PT:
-            text = String::number(m_value.num) + "pt";
+            text = String::format("%.6lgpt", m_value.num);
             break;
         case CSS_PC:
-            text = String::number(m_value.num) + "pc";
+            text = String::format("%.6lgpc", m_value.num);
             break;
         case CSS_DEG:
-            text = String::number(m_value.num) + "deg";
+            text = String::format("%.6lgdeg", m_value.num);
             break;
         case CSS_RAD:
-            text = String::number(m_value.num) + "rad";
+            text = String::format("%.6lgrad", m_value.num);
             break;
         case CSS_GRAD:
-            text = String::number(m_value.num) + "grad";
+            text = String::format("%.6lggrad", m_value.num);
             break;
         case CSS_MS:
-            text = String::number(m_value.num) + "ms";
+            text = String::format("%.6lgms", m_value.num);
             break;
         case CSS_S:
-            text = String::number(m_value.num) + "s";
+            text = String::format("%.6lgs", m_value.num);
             break;
         case CSS_HZ:
-            text = String::number(m_value.num) + "hz";
+            text = String::format("%.6lghz", m_value.num);
             break;
         case CSS_KHZ:
-            text = String::number(m_value.num) + "khz";
+            text = String::format("%.6lgkhz", m_value.num);
             break;
         case CSS_DIMENSION:
             // FIXME