8000 prevent warnings · numpy/numpy@0efaea3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0efaea3

Browse files
committed
prevent warnings
1 parent dc38ebd commit 0efaea3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numpy/random/generator.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,19 +694,19 @@ cdef class Generator:
694694
set_size = <uint64_t>(1.2 * size_i)
695695
mask = _gen_mask(set_size)
696696
set_size = 1 + mask
697-
hash_set = np.full(set_size, -1, np.uint64)
697+
hash_set = np.full(set_size, <uint64_t>-1, np.uint64)
698698
with self.lock, cython.wraparound(False):
699699
for j in range(pop_size_i - size_i, pop_size_i):
700700
val = random_bounded_uint64(&self._bitgen, 0, j, 0, 0)
701701
loc = val & mask
702-
while hash_set[loc] != -1 and hash_set[loc] != val:
702+
while hash_set[loc] != <uint64_t>-1 and hash_set[loc] != <uint64_t>val:
703703
loc = (loc + 1) & mask
704-
if hash_set[loc] == -1: # then val not in hash_set
704+
if hash_set[loc] == <uint64_t>-1: # then val not in hash_set
705705
hash_set[loc] = val
706706
idx_data[j - pop_size_i + size_i] = val
707707
else: # we need to insert j instead
708708
loc = j & mask
709-
while hash_set[loc] != -1:
709+
while hash_set[loc] != <uint64_t>-1:
710710
loc = (loc + 1) & mask
711711
hash_set[loc] = j
712712
idx_data[j - pop_size_i + size_i] = j

0 commit comments

Comments
 (0)
0