changed:
authorStefan Vogel <sv@exept.de>
Sat, 06 Mar 2010 14:31:19 +0100
changeset 12763 e19933d3e188
parent 12762 a41a496d8c61
child 12764 c3da6be46ff1
changed: #compareCollatingWith: #hash - cpmatibility with ImmutableString
String.st
--- a/String.st	Sat Mar 06 12:29:09 2010 +0100
+++ b/String.st	Sat Mar 06 14:31:19 2010 +0100
@@ -1566,45 +1566,45 @@
     OBJ myCls;
 
     if (__isNonNilObject(s)) {
-	cls = __qClass(s);
-	myCls = __qClass(self);
-
-	if ((cls == String) || (cls == Symbol) || (cls == myCls)) {
-	    cp1 = __stringVal(self);
-
-	    /*
-	     * care for instances of subclasses ...
-	     */
-	    if (myCls != String) {
-		int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(myCls)->c_ninstvars));
-
-		cp1 += n;
-	    }
-
-	    cp2 = __stringVal(s);
-	    /*
-	     * care for instances of subclasses ...
-	     */
-	    if (cls != String) {
-		int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-
-		cp2 += n;
-	    }
+        cls = __qClass(s);
+        myCls = __qClass(self);
+
+        if (__isStringLike(s) || (cls == myCls)) {
+            cp1 = __stringVal(self);
+
+            /*
+             * care for instances of subclasses ...
+             */
+            if (myCls != String) {
+                int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(myCls)->c_ninstvars));
+
+                cp1 += n;
+            }
+
+            cp2 = __stringVal(s);
+            /*
+             * care for instances of subclasses ...
+             */
+            if (cls != String) {
+                int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+
+                cp2 += n;
+            }
 
 #ifdef HAS_STRCOLL
-	    cmp = strcoll(cp1, cp2);
+            cmp = strcoll(cp1, cp2);
 #else
-	    cmp = strcmp(cp1, cp2);
+            cmp = strcmp(cp1, cp2);
 #endif
 
-	    if (cmp > 0) {
-		RETURN ( __mkSmallInteger(1) );
-	    }
-	    if (cmp < 0) {
-		RETURN ( __mkSmallInteger(-1) );
-	    }
-	    RETURN ( __mkSmallInteger(0) );
-	}
+            if (cmp > 0) {
+                RETURN ( __mkSmallInteger(1) );
+            }
+            if (cmp < 0) {
+                RETURN ( __mkSmallInteger(-1) );
+            }
+            RETURN ( __mkSmallInteger(0) );
+        }
     }
 %}.
     "
@@ -1670,7 +1670,7 @@
      * This speeds up Set and Dictionary by a factor of 10!
      */
     val *= 31415821;
-    RETURN ( __mkSmallInteger(val & 0x3fffffff));
+    RETURN ( __mkSmallInteger(val & _MAX_INT));
 %}
 !
 
@@ -1965,18 +1965,6 @@
     "Modified: / 02-08-2007 / 16:43:29 / cg"
 !
 
-uncapitalized
-        "Answer a <readableString> which is a copy of the receiver but with
-        the first character converted to its lowercase equivalent."
-
-        ^ self asLowercaseFirst
-"/        | answer |
-"/        #swAdded.
-"/        (answer := self copy) isEmpty ifFalse: [
-"/                answer at: 1 put: (self first asLowercase)].
-"/        ^answer
-!
-
 withTabsExpanded:numSpaces
     "return a string with the characters of the receiver where all tabulator characters
      are expanded into spaces (assuming numSpaces-col tabs).
@@ -3258,7 +3246,6 @@
 ! !
 
 
-
 !String methodsFor:'substring searching'!
 
 indexOfSubCollection:aSubString startingAt:startIndex ifAbsent:exceptionValue caseSensitive:caseSensitive
@@ -3722,9 +3709,9 @@
 !String class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.270 2010-02-10 17:47:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.271 2010-03-06 13:31:19 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.270 2010-02-10 17:47:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.271 2010-03-06 13:31:19 stefan Exp $'
 ! !