]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/NumericStrings.h
JavaScriptCore-903.5.tar.gz
[apple/javascriptcore.git] / runtime / NumericStrings.h
index 89235af7766eb40b12f46913460f8988b039d8c3..d65f14265cdf63fb7449fa49e6f4ef8cdf00af1e 100644 (file)
@@ -27,6 +27,7 @@
 #define NumericStrings_h
 
 #include "UString.h"
+#include <wtf/FixedArray.h>
 #include <wtf/HashFunctions.h>
 
 namespace JSC {
@@ -39,7 +40,7 @@ namespace JSC {
             if (d == entry.key && !entry.value.isNull())
                 return entry.value;
             entry.key = d;
-            entry.value = UString::from(d);
+            entry.value = UString::number(d);
             return entry.value;
         }
 
@@ -51,7 +52,7 @@ namespace JSC {
             if (i == entry.key && !entry.value.isNull())
                 return entry.value;
             entry.key = i;
-            entry.value = UString::from(i);
+            entry.value = UString::number(i);
             return entry.value;
         }
 
@@ -63,7 +64,7 @@ namespace JSC {
             if (i == entry.key && !entry.value.isNull())
                 return entry.value;
             entry.key = i;
-            entry.value = UString::from(i);
+            entry.value = UString::number(i);
             return entry.value;
         }
     private:
@@ -82,14 +83,14 @@ namespace JSC {
         {
             ASSERT(i < cacheSize);
             if (smallIntCache[i].isNull())
-                smallIntCache[i] = UString::from(i);
+                smallIntCache[i] = UString::number(i);
             return smallIntCache[i];
         }
 
-        CacheEntry<double> doubleCache[cacheSize];
-        CacheEntry<int> intCache[cacheSize];
-        CacheEntry<unsigned> unsignedCache[cacheSize];
-        UString smallIntCache[cacheSize];
+        FixedArray<CacheEntry<double>, cacheSize> doubleCache;
+        FixedArray<CacheEntry<int>, cacheSize> intCache;
+        FixedArray<CacheEntry<unsigned>, cacheSize> unsignedCache;
+        FixedArray<UString, cacheSize> smallIntCache;
     };
 
 } // namespace JSC