[pypy-commit] pypy inline-dict-ops: Re-simplify this code.

arigo noreply at buildbot.pypy.org
Sat Jul 23 20:47:47 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: inline-dict-ops
Changeset: r45914:e6c306ce9172
Date: 2011-07-23 20:47 +0200
http://bitbucket.org/pypy/pypy/changeset/e6c306ce9172/

Log:	Re-simplify this code.

diff --git a/pypy/jit/codewriter/jtransform.py b/pypy/jit/codewriter/jtransform.py
--- a/pypy/jit/codewriter/jtransform.py
+++ b/pypy/jit/codewriter/jtransform.py
@@ -709,7 +709,7 @@
         else:
             v_inst, v_index, c_field = op.args
             if op.result.concretetype is lltype.Void:
-                return Constant(None, lltype.Void)
+                return
             # only GcArray of Struct supported
             assert isinstance(v_inst.concretetype.TO, lltype.GcArray)
             STRUCT = v_inst.concretetype.TO.OF
diff --git a/pypy/jit/codewriter/test/test_jtransform.py b/pypy/jit/codewriter/test/test_jtransform.py
--- a/pypy/jit/codewriter/test/test_jtransform.py
+++ b/pypy/jit/codewriter/test/test_jtransform.py
@@ -661,7 +661,7 @@
     op = SpaceOperation('getinteriorfield', [v, i, Constant('v', lltype.Void)],
                         Constant(None, lltype.Void))
     op1 = Transformer(FakeCPU()).rewrite_operation(op)
-    assert op1 == Constant(None, lltype.Void)
+    assert op1 is None
 
 def test_str_setinteriorfield():
     v = varoftype(lltype.Ptr(rstr.STR))


More information about the pypy-commit mailing list