make sure that hash returns a smallInt
authorClaus Gittinger <cg@exept.de>
Thu, 09 Oct 2014 14:36:29 +0200
changeset 16900 04c111f73292
parent 16899 c8de03aacca0
child 16901 8394ec484888
make sure that hash returns a smallInt
String.st
--- a/String.st	Thu Oct 09 14:35:52 2014 +0200
+++ b/String.st	Thu Oct 09 14:36:29 2014 +0200
@@ -1795,7 +1795,9 @@
     while (l--) {
 	h = (h ^ *cp++) * 16777619;
     }
-    RETURN ( __MKUINT(h));
+    // make it a smallInteger
+    h = (h ^ (h >> 30)) & 0x3FFFFFFF;
+    RETURN ( __mkSmallInteger(h));
 %}
 
     "
@@ -4046,9 +4048,9 @@
 !String class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.323 2014-10-08 12:50:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.324 2014-10-09 12:36:29 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.323 2014-10-08 12:50:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.324 2014-10-09 12:36:29 cg Exp $'
 ! !