#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Tue, 19 Jul 2016 17:32:02 +0200
changeset 20162 b9a62e66a27d
parent 20161 64cc230c5a10
child 20163 3855e97fe259
#REFACTORING by stefan class: String changed: #asSymbolIfInterned
String.st
--- a/String.st	Tue Jul 19 17:31:14 2016 +0200
+++ b/String.st	Tue Jul 19 17:32:02 2016 +0200
@@ -443,7 +443,6 @@
     "
 ! !
 
-
 !String class methodsFor:'Compatibility-Dolphin'!
 
 lineDelimiter
@@ -549,21 +548,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 !String methodsFor:'accessing'!
 
 at:index
@@ -2602,7 +2586,7 @@
 asSymbolIfInterned
     "If a symbol with the receiver's characters is already known, return it. Otherwise, return nil.
      This can be used to query for an existing symbol and is the same as:
-	self knownAsSymbol ifTrue:[self asSymbol] ifFalse:[nil]
+        self knownAsSymbol ifTrue:[self asSymbol] ifFalse:[nil]
      but slightly faster, since the symbol lookup operation is only
      performed once."
 
@@ -2612,14 +2596,13 @@
 
     return context._RETURN( symbolOrNull == null ? STObject.Nil : symbolOrNull );
 #else
-    OBJ cls;
+    OBJ cls = __qClass(self);
     int indx;
 
-    cls = __qClass(self);
-    if (cls != String) {
-	indx = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+    if (cls != String && cls != ImmutableString) {
+        indx = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
     } else {
-	indx = 0;
+        indx = 0;
     }
     RETURN ( __SYMBOL_OR_NIL(__stringVal(self) + indx));
 #endif /* not __SCHTEAM__ */