[pypy-svn] r74498 - pypy/trunk/pypy/rpython/lltypesystem

afa at codespeak.net afa at codespeak.net
Wed May 12 13:29:20 CEST 2010


Author: afa
Date: Wed May 12 13:29:17 2010
New Revision: 74498

Modified:
   pypy/trunk/pypy/rpython/lltypesystem/rstr.py
Log:
The 'if else' syntax is not clearer here, let the module import even with python2.4


Modified: pypy/trunk/pypy/rpython/lltypesystem/rstr.py
==============================================================================
--- pypy/trunk/pypy/rpython/lltypesystem/rstr.py	(original)
+++ pypy/trunk/pypy/rpython/lltypesystem/rstr.py	Wed May 12 13:29:17 2010
@@ -607,13 +607,19 @@
                         i += mlast
                         continue
 
-                    c = '\0' if i+m == len(s1.chars) else s1.chars[i+m]
+                    if i + m < len(s1.chars):
+                        c = s1.chars[i + m]
+                    else:
+                        c = '\0'
                     if not bloom(mask, c):
                         i += m
                     else:
                         i += skip
                 else:
-                    c = '\0' if i+m == len(s1.chars) else s1.chars[i+m]
+                    if i + m < len(s1.chars):
+                        c = s1.chars[i + m]
+                    else:
+                        c = '\0'
                     if not bloom(mask, c):
                         i += m
         else:



More information about the Pypy-commit mailing list