[pypy-svn] r77165 - in pypy/branch/better-map-instances/pypy: interpreter objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Sat Sep 18 00:32:15 CEST 2010


Author: cfbolz
Date: Sat Sep 18 00:32:14 2010
New Revision: 77165

Modified:
   pypy/branch/better-map-instances/pypy/interpreter/baseobjspace.py
   pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py
Log:
- add assert
- fix translation


Modified: pypy/branch/better-map-instances/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/branch/better-map-instances/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/branch/better-map-instances/pypy/interpreter/baseobjspace.py	Sat Sep 18 00:32:14 2010
@@ -177,7 +177,7 @@
         raise NotImplementedError
     def _mapdict_storage_length(self):
         raise NotImplementedError
-    def _set_mapdict_storage(self, storage):
+    def _set_mapdict_storage_and_map(self, storage, map):
         raise NotImplementedError
 
 

Modified: pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py
==============================================================================
--- pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py	(original)
+++ pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py	Sat Sep 18 00:32:14 2010
@@ -472,6 +472,9 @@
                 # storage is longer than self.map.length() only due to
                 # overallocation
                 erased = rerased.erase(storage[nmin1])
+                # in theory, we should be ultra-paranoid and check all entries,
+                # but checking just one should catch most problems anyway:
+                assert storage[n + 1] is None
             else:
                 storage_list = storage[nmin1:]
                 erased = rerased.erase_fixedsizelist(storage_list, W_Root)



More information about the Pypy-commit mailing list