[pypy-svn] r17303 - pypy/dist/pypy/module/marshal

tismer at codespeak.net tismer at codespeak.net
Tue Sep 6 22:19:27 CEST 2005


Author: tismer
Date: Tue Sep  6 22:19:26 2005
New Revision: 17303

Modified:
   pypy/dist/pypy/module/marshal/interp_marshal.py
Log:
making use of the fact that rlist supports in-place multiplication

Modified: pypy/dist/pypy/module/marshal/interp_marshal.py
==============================================================================
--- pypy/dist/pypy/module/marshal/interp_marshal.py	(original)
+++ pypy/dist/pypy/module/marshal/interp_marshal.py	Tue Sep  6 22:19:26 2005
@@ -217,7 +217,7 @@
         lng = len(s)
         newpos = pos + lng
         while len(self.buflis) < newpos:
-            self.buflis = self.buflis + self.buflis
+            self.buflis *= 2
         idx = 0
         while idx < lng:
             self.buflis[pos + idx] = s[idx]
@@ -228,7 +228,7 @@
         pos = self.bufpos
         newpos = pos + 1
         if len(self.buflis) < newpos:
-            self.buflis = self.buflis + self.buflis
+            self.buflis *= 2
         self.buflis[pos] = c
         self.bufpos = newpos
 
@@ -243,7 +243,7 @@
         pos = self.bufpos
         newpos = pos + 5
         if len(self.buflis) < newpos:
-            self.buflis = self.buflis + self.buflis
+            self.buflis *= 2
         self.buflis[pos] = typecode
         self.buflis[pos+1] = a
         self.buflis[pos+2] = b
@@ -258,7 +258,7 @@
         pos = self.bufpos
         newpos = pos + 2
         if len(self.buflis) < newpos:
-            self.buflis = self.buflis + self.buflis
+            self.buflis *= 2
         self.buflis[pos]   = a
         self.buflis[pos+1] = b
         self.bufpos = newpos
@@ -274,7 +274,7 @@
         pos = self.bufpos
         newpos = pos + 4
         if len(self.buflis) < newpos:
-            self.buflis = self.buflis + self.buflis
+            self.buflis *= 2
         self.buflis[pos]   = a
         self.buflis[pos+1] = b
         self.buflis[pos+2] = c



More information about the Pypy-commit mailing list