[pypy-svn] r39957 - pypy/branch/rope-branch/pypy/objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Mar 5 15:08:38 CET 2007


Author: cfbolz
Date: Mon Mar  5 15:08:36 2007
New Revision: 39957

Modified:
   pypy/branch/rope-branch/pypy/objspace/std/rope.py
Log:
hopefully fix an annotation problem


Modified: pypy/branch/rope-branch/pypy/objspace/std/rope.py
==============================================================================
--- pypy/branch/rope-branch/pypy/objspace/std/rope.py	(original)
+++ pypy/branch/rope-branch/pypy/objspace/std/rope.py	Mon Mar  5 15:08:36 2007
@@ -12,6 +12,7 @@
 MAX_DEPTH = 32 # maybe should be smaller
 MIN_SLICE_LENGTH = 64
 CONCATENATE_WHEN_MULTIPLYING = 128
+HIGHEST_BIT_SET = intmask(1L << (NBITS - 1))
 
 def find_fib_index(l):
     if l == 0:
@@ -113,7 +114,7 @@
             for c in self.s:
                 x = (1000003*x) + ord(c)
             x = intmask(x)
-            x |= intmask(1L << (NBITS - 1))
+            x |= HIGHEST_BIT_SET
             h = self.hash_cache = x
         return h
 
@@ -186,7 +187,7 @@
             h1 = self.left.hash_part()
             h2 = self.right.hash_part()
             x = intmask(h2 + h1 * (masked_power(1000003, self.right.length())))
-            x |= intmask(1L << (NBITS - 1))
+            x |= HIGHEST_BIT_SET
             h = self.hash_cache = x
         return h
 
@@ -236,7 +237,7 @@
             for i in range(self.start, self.stop):
                 x = (1000003*x) + ord(self.node.getitem(i))
             x = intmask(x)
-            x |= intmask(1L << (NBITS - 1))
+            x |= HIGHEST_BIT_SET
             h = self.hash_cache = x
         return h
 



More information about the Pypy-commit mailing list