1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
From 34e2ed77176993fcde082118916d3b53e84d8f86 Mon Sep 17 00:00:00 2001
From: Stuart Archibald <stuartarchibald@users.noreply.github.com>
Origin: https://github.com/numba/numba/pull/8639
Date: Tue, 22 Nov 2022 14:02:52 +0000
Subject: [PATCH 02/20] Fix flake8
As title.
---
numba/cpython/hashing.py | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/numba/cpython/hashing.py b/numba/cpython/hashing.py
index 49e7abdbb46..5f549d95ea3 100644
--- a/numba/cpython/hashing.py
+++ b/numba/cpython/hashing.py
@@ -531,7 +531,6 @@ def inject(name, val):
# DOUBLE_ROUND in siphash24, and that siphash13 has an extra "ROUND" applied
# just before the final XORing of components to create the return value.
-
# /* *********************************************************************
# <MIT License>
# Copyright (c) 2013 Marek Majkowski <marek@popcount.org>
@@ -651,34 +650,34 @@ def _siphash(k0, k1, src, src_sz):
jmp = (6 * 8)
mask = ~types.uint64(ohexefef << jmp)
t = (t & mask) | (types.uint64(grab_byte(src, boffset + 6))
- << jmp)
+ << jmp)
if src_sz >= 6:
jmp = (5 * 8)
mask = ~types.uint64(ohexefef << jmp)
t = (t & mask) | (types.uint64(grab_byte(src, boffset + 5))
- << jmp)
+ << jmp)
if src_sz >= 5:
jmp = (4 * 8)
mask = ~types.uint64(ohexefef << jmp)
t = (t & mask) | (types.uint64(grab_byte(src, boffset + 4))
- << jmp)
+ << jmp)
if src_sz >= 4:
t &= types.uint64(0xffffffff00000000)
for i in range(4):
jmp = i * 8
mask = ~types.uint64(ohexefef << jmp)
t = (t & mask) | (types.uint64(grab_byte(src, boffset + i))
- << jmp)
+ << jmp)
if src_sz >= 3:
jmp = (2 * 8)
mask = ~types.uint64(ohexefef << jmp)
t = (t & mask) | (types.uint64(grab_byte(src, boffset + 2))
- << jmp)
+ << jmp)
if src_sz >= 2:
jmp = (1 * 8)
mask = ~types.uint64(ohexefef << jmp)
t = (t & mask) | (types.uint64(grab_byte(src, boffset + 1))
- << jmp)
+ << jmp)
if src_sz >= 1:
mask = ~(ohexefef)
t = (t & mask) | (types.uint64(grab_byte(src, boffset + 0)))
@@ -697,11 +696,10 @@ def _siphash(k0, k1, src, src_sz):
return _siphash
-
_siphash13 = _gen_siphash('siphash13')
_siphash24 = _gen_siphash('siphash24')
- _siphasher = _siphash13 if _Py_hashfunc_name == 'siphash13' else _siphash24
+ _siphasher = _siphash13 if _Py_hashfunc_name == 'siphash13' else _siphash24
else:
msg = "Unsupported hashing algorithm in use %s" % _Py_hashfunc_name
|