[pypy-commit] pypy kwargsdict-strategy: more translation fixes

cfbolz noreply at buildbot.pypy.org
Sat Apr 7 15:04:25 CEST 2012


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: kwargsdict-strategy
Changeset: r54232:6fce95c0e36e
Date: 2012-04-06 16:40 +0200
http://bitbucket.org/pypy/pypy/changeset/6fce95c0e36e/

Log:	more translation fixes

diff --git a/pypy/objspace/std/kwargsdict.py b/pypy/objspace/std/kwargsdict.py
--- a/pypy/objspace/std/kwargsdict.py
+++ b/pypy/objspace/std/kwargsdict.py
@@ -45,9 +45,12 @@
             self.switch_to_object_strategy(w_dict)
             w_dict.setitem(w_key, w_value)
 
+    def setitem_str(self, w_dict, key, w_value):
+        self._setitem_str_indirection(w_dict, key, w_value)
+
     @jit.look_inside_iff(lambda self, w_dict, key, w_value:
             jit.isconstant(self.length(w_dict)) and jit.isconstant(key))
-    def setitem_str(self, w_dict, key, w_value):
+    def _setitem_str_indirection(self, w_dict, key, w_value):
         keys, values_w = self.unerase(w_dict.dstorage)
         result = []
         for i in range(len(keys)):
@@ -76,8 +79,11 @@
     def length(self, w_dict):
         return len(self.unerase(w_dict.dstorage)[0])
 
+    def getitem_str(self, w_dict, key):
+        return self._getitem_str_indirection(w_dict, key)
+
     @jit.look_inside_iff(lambda self, w_dict, key: jit.isconstant(self.length(w_dict)) and jit.isconstant(key))
-    def getitem_str(self, w_dict, key):
+    def _getitem_str_indirection(self, w_dict, key):
         keys, values_w = self.unerase(w_dict.dstorage)
         result = []
         for i in range(len(keys)):


More information about the pypy-commit mailing list