delay initialization of cachedTypes
authorClaus Gittinger <cg@exept.de>
Fri, 20 Jul 2012 17:34:32 +0200
changeset 3011 f2af94d78383
parent 3010 3d75dd48f9c6
child 3012 af9c31ac2fc1
delay initialization of cachedTypes
MIMETypes.st
--- a/MIMETypes.st	Wed Jul 18 19:13:00 2012 +0200
+++ b/MIMETypes.st	Fri Jul 20 17:34:32 2012 +0200
@@ -1247,16 +1247,6 @@
 "
 ! !
 
-!MIMETypes::MIMEType class methodsFor:'initialization'!
-
-initialize
-    CachedTypes := CacheDictionary new:30.
-
-    "
-     self initialize
-    "
-! !
-
 !MIMETypes::MIMEType class methodsFor:'instance creation'!
 
 fromString:aString
@@ -1264,8 +1254,12 @@
 
     aString class == self ifTrue:[^ aString].
 
+    CachedTypes isNil ifTrue:[
+        CachedTypes := CacheDictionary new:100.
+    ].
     cachedType := CachedTypes at:aString ifAbsent:nil.
     cachedType notNil ifTrue:[^ cachedType].
+
     newType := aString copy changeClassTo:self.
     CachedTypes at:aString put:newType.
     ^ newType
@@ -1273,6 +1267,8 @@
     "
      self fromString:'text/html'
     "
+
+    "Modified: / 20-07-2012 / 17:32:37 / cg"
 ! !
 
 !MIMETypes::MIMEType methodsFor:'queries'!
@@ -1342,12 +1338,11 @@
 !MIMETypes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.120 2012-05-27 10:53:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.121 2012-07-20 15:34:32 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.120 2012-05-27 10:53:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.121 2012-07-20 15:34:32 cg Exp $'
 ! !
 
 MIMETypes initialize!
-MIMETypes::MIMEType initialize!