Skip to content

Commit c3dabb2

Browse files
Prerak SinghPrerak Singh
authored andcommitted
bug fix
1 parent 58f860c commit c3dabb2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pydatastructs/linear_data_structures/_backend/cpp/algorithms/quadratic_time_sort.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ static PyObject* bubble_sort_llvm(PyObject* self, PyObject* args, PyObject* kwds
346346
return NULL;
347347
}
348348

349+
Py_INCREF(Py_None);
349350
int result = PyObject_SetItem(arr_obj, index_obj, new_value);
350351
Py_DECREF(index_obj);
351352
Py_DECREF(new_value);
@@ -359,6 +360,7 @@ static PyObject* bubble_sort_llvm(PyObject* self, PyObject* args, PyObject* kwds
359360
return NULL;
360361
}
361362

363+
Py_INCREF(Py_None);
362364
int result = PyObject_SetItem(arr_obj, index_obj, Py_None);
363365
Py_DECREF(index_obj);
364366
}
@@ -425,6 +427,7 @@ static PyObject* bubble_sort_llvm(PyObject* self, PyObject* args, PyObject* kwds
425427
if (!index_obj) {
426428
return NULL;
427429
}
430+
Py_INCREF(Py_None);
428431
int result = PyObject_SetItem(arr_obj, index_obj, Py_None);
429432
Py_DECREF(index_obj);
430433
}
@@ -509,7 +512,7 @@ static PyObject* bubble_sort_llvm(PyObject* self, PyObject* args, PyObject* kwds
509512
if (!index_obj) {
510513
return NULL;
511514
}
512-
515+
Py_INCREF(Py_None);
513516
int result = PyObject_SetItem(arr_obj, index_obj, Py_None);
514517
Py_DECREF(index_obj);
515518
}
@@ -575,7 +578,7 @@ static PyObject* bubble_sort_llvm(PyObject* self, PyObject* args, PyObject* kwds
575578
if (!index_obj) {
576579
return NULL;
577580
}
578-
581+
Py_INCREF(Py_None);
579582
int result = PyObject_SetItem(arr_obj, index_obj, Py_None);
580583
Py_DECREF(index_obj);
581584
}

0 commit comments

Comments
 (0)