[pypy-commit] pypy default: Replace "if" with an "assert", because it's supposed to be always

arigo noreply at buildbot.pypy.org
Tue May 24 15:57:17 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r44405:b8f0dd433e8b
Date: 2011-05-24 14:39 +0200
http://bitbucket.org/pypy/pypy/changeset/b8f0dd433e8b/

Log:	Replace "if" with an "assert", because it's supposed to be always
	the case.

diff --git a/pypy/jit/backend/x86/assembler.py b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -137,10 +137,10 @@
         self.current_clt = looptoken.compiled_loop_token
         self.pending_guard_tokens = []
         self.mc = codebuf.MachineCodeBlockWrapper()
-        if self.datablockwrapper is None:
-            allblocks = self.get_asmmemmgr_blocks(looptoken)
-            self.datablockwrapper = MachineDataBlockWrapper(self.cpu.asmmemmgr,
-                                                            allblocks)
+        assert self.datablockwrapper is None
+        allblocks = self.get_asmmemmgr_blocks(looptoken)
+        self.datablockwrapper = MachineDataBlockWrapper(self.cpu.asmmemmgr,
+                                                        allblocks)
 
     def teardown(self):
         self.pending_guard_tokens = None


More information about the pypy-commit mailing list