Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r97336:178d36cf8694
Date: 2019-08-29 19:55 +0200
http://bitbucket.org/pypy/pypy/changeset/178d36cf8694/

Log:    Don't use range() in a function with @no_collect

diff --git a/rpython/rlib/rsiphash.py b/rpython/rlib/rsiphash.py
--- a/rpython/rlib/rsiphash.py
+++ b/rpython/rlib/rsiphash.py
@@ -170,10 +170,12 @@
         # unicode strings where CPython uses 2 bytes per character.
         addr = rstr._get_raw_buf_unicode(rstr.UNICODE, ll_s, 0)
         SZ = rffi.sizeof(rstr.UNICODE.chars.OF)
-        for i in range(length):
+        i = 0
+        while i < length:
             if ord(ll_s.chars[i]) > 0xFF:
                 length *= SZ
                 break
+            i += 1
         else:
             x = _siphash24(addr, length, SZ)
             keepalive_until_here(ll_s)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to