[pypy-svn] r59430 - pypy/trunk/pypy/objspace/std

fijal at codespeak.net fijal at codespeak.net
Sun Oct 26 22:23:54 CET 2008


Author: fijal
Date: Sun Oct 26 22:23:53 2008
New Revision: 59430

Modified:
   pypy/trunk/pypy/objspace/std/ropeobject.py
Log:
yet-another-almost-identical-logic


Modified: pypy/trunk/pypy/objspace/std/ropeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/ropeobject.py	(original)
+++ pypy/trunk/pypy/objspace/std/ropeobject.py	Sun Oct 26 22:23:53 2008
@@ -496,7 +496,7 @@
 
     d = arg - length
     if d>0:
-        offset = d//2
+        offset = d//2 + (d & arg & 1)
         fillcharnode = rope.LiteralStringNode.PREBUILT[ord(fillchar)]
         pre = rope.multiply(fillcharnode, offset)
         post = rope.multiply(fillcharnode, (d - offset))



More information about the Pypy-commit mailing list