[pypy-commit] pypy json-decoder-maps: fix bytes/WORD_SIZE confusion (thanks Armin)

cfbolz pypy.commits at gmail.com
Fri Sep 20 06:40:02 EDT 2019


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: json-decoder-maps
Changeset: r97566:3a51f8eb6272
Date: 2019-09-20 12:32 +0200
http://bitbucket.org/pypy/pypy/changeset/3a51f8eb6272/

Log:	fix bytes/WORD_SIZE confusion (thanks Armin)

diff --git a/pypy/module/_pypyjson/simd.py b/pypy/module/_pypyjson/simd.py
--- a/pypy/module/_pypyjson/simd.py
+++ b/pypy/module/_pypyjson/simd.py
@@ -194,8 +194,8 @@
         bits |= ord(ch)
 
         word |= ord(ch) << shift
-        shift += WORD_SIZE
-        if shift == WORD_SIZE * WORD_SIZE:
+        shift += 8
+        if shift == WORD_SIZE * 8:
             strhash = intmask((1000003 * strhash) ^ word)
             shift = 0
             word = 0


More information about the pypy-commit mailing list