Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: virtual-arguments
Changeset: r56227:08d919b041ca
Date: 2012-07-19 18:18 +0200
http://bitbucket.org/pypy/pypy/changeset/08d919b041ca/

Log:    more of the same

diff --git a/pypy/module/unicodedata/interp_ucd.py 
b/pypy/module/unicodedata/interp_ucd.py
--- a/pypy/module/unicodedata/interp_ucd.py
+++ b/pypy/module/unicodedata/interp_ucd.py
@@ -251,8 +251,9 @@
                     result[j + 1] = V
                     j += 2
                 else:
-                    if j + 3 > resultlen:
-                        result.extend([0] * (j + 3 - resultlen + 10))
+                    lgt = j + 2 - resultlen
+                    if lgt > 0:
+                        result.extend([0] * (lgt + 10))
                         resultlen = len(result)
                     result[j] = L
                     result[j + 1] = V
@@ -262,15 +263,17 @@
             decomp = decomposition(ch)
             if decomp:
                 decomplen = len(decomp)
-                if j + decomplen > resultlen:
-                    result.extend([0] * (j + decomplen - resultlen + 10))
+                lgt = j + decomplen - resultlen
+                if lgt > 0:
+                    result.extend([0] * (lgt + 10))
                     resultlen = len(result)
                 for ch in decomp:
                     result[j] = ch
                     j += 1
             else:
-                if j + 1 > resultlen:
-                    result.extend([0] * (j + 1 - resultlen + 10))
+                lgt = j + 1 - resultlen
+                if lgt > 0:
+                    result.extend([0] * (lgt + 10))
                     resultlen = len(result)
                 result[j] = ch
                 j += 1
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to