Commits

Maciej Fijalkowski committed f5d98cc

eh, comparison too?

Comments (0)

Files changed (1)

pypy/rlib/dict.py

                                   ('value', llmemory.GCREF)))
 MAIN_TP = lltype.GcArray(rffi.INT_real)
 
-FREE = rffi.cast(rffi.INT_real, -1)
-DUMMY = rffi.cast(rffi.INT_real, -2)
+FREE = -1
+DUMMY = -2
 
 class Dict(object):
     'Space efficient dictionary with fast iteration and cheap resizes.'
         #if n <= 2**31: return array.array('l', [FREE]) * n      # signed long
         v = lltype.malloc(MAIN_TP, n)
         for i in range(n):
-            v[i] = FREE
+            v[i] = rffi.cast(rffi.INT_real, FREE)
         return v
 
     def _resize(self, n):
                 perturb = hashvalue
             i = hashvalue & (n - 1)
             while True:
-                if self.indices[i] == FREE:
+                if rffi.cast(lltype.Signed, self.indices[i]) == FREE:
                     break
                 i = 5 * i + perturb + 1
                 i = i & (n - 1)