Skip to content

Commit ea72d88

Browse files
authored
Merge pull request numpy#25115 from charris/backport-25032
MAINT: Add missing `noexcept` to shuffle helpers
2 parents 1faa0f0 + c2f0c44 commit ea72d88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numpy/random/_generator.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cdef int64_t _safe_sum_nonneg_int64(size_t num_colors, int64_t *colors):
6363
cdef inline void _shuffle_raw_wrap(bitgen_t *bitgen, np.npy_intp n,
6464
np.npy_intp first, np.npy_intp itemsize,
6565
np.npy_intp stride,
66-
char* data, char* buf) nogil:
66+
char* data, char* buf) noexcept nogil:
6767
# We trick gcc into providing a specialized implementation for
6868
# the most common case, yielding a ~33% performance improvement.
6969
# Note that apparently, only one branch can ever be specialized.
@@ -76,7 +76,7 @@ cdef inline void _shuffle_raw_wrap(bitgen_t *bitgen, np.npy_intp n,
7676
cdef inline void _shuffle_raw(bitgen_t *bitgen, np.npy_intp n,
7777
np.npy_intp first, np.npy_intp itemsize,
7878
np.npy_intp stride,
79-
char* data, char* buf) nogil:
79+
char* data, char* buf) noexcept nogil:
8080
"""
8181
Parameters
8282
----------
@@ -107,7 +107,7 @@ cdef inline void _shuffle_raw(bitgen_t *bitgen, np.npy_intp n,
107107

108108

109109
cdef inline void _shuffle_int(bitgen_t *bitgen, np.npy_intp n,
110-
np.npy_intp first, int64_t* data) nogil:
110+
np.npy_intp first, int64_t* data) noexcept nogil:
111111
"""
112112
Parameters
113113
----------

0 commit comments

Comments
 (0)