Skip to content

Commit fb47e3e

Browse files
committed
fix: PyObject_CallObject() is slightly faster when generating random numbers
1 parent 0abc0dd commit fb47e3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_igraph/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ unsigned long int igraph_rng_Python_get(void *state) {
125125
* \brief Generates a real number between 0 and 1 using the Python random number generator.
126126
*/
127127
igraph_real_t igraph_rng_Python_get_real(void *state) {
128-
PyObject* result = PyObject_CallFunction(igraph_rng_Python_state.random_func, NULL);
128+
PyObject* result = PyObject_CallObject(igraph_rng_Python_state.random_func, 0);
129129
double retval;
130130

131131
if (result == 0) {

0 commit comments

Comments
 (0)