File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
pydatastructs/linear_data_structures/_backend/cpp/arrays Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ static void ArrayForTrees_dealloc(ArrayForTrees *self) {
20
20
}
21
21
22
22
static PyObject* ArrayForTrees__modify (ArrayForTrees *self) {
23
- if (((double )self->_num /(double )self->_size ) < self->_load_factor ){
23
+ if (((double )self->_dynamic_one_dimensional_array -> _num /(double )self->_dynamic_one_dimensional_array -> _size ) < self-> _dynamic_one_dimensional_array ->_load_factor ){
24
24
PyObject* new_indices = PyDict_New ();
25
25
26
26
// PyObject* arr_new = OneDimensionalArray___new__(&TreeNodeType, reinterpret_cast<PyObject*>(2*self->_num + 1));
27
27
// This is how arr_new was made in DynamicOneDimensionalArray__modify() for the previous line :-
28
- long new_size = 2 * self->_num + 1 ;
28
+ long new_size = 2 * self->_dynamic_one_dimensional_array -> _num + 1 ;
29
29
PyObject** arr_new = reinterpret_cast <PyObject**>(std::malloc (new_size * sizeof (PyObject*)));
30
30
for ( int i = 0 ; i < new_size; i++ ) {
31
31
Py_INCREF (Py_None);
@@ -34,7 +34,7 @@ static PyObject* ArrayForTrees__modify(ArrayForTrees *self) {
34
34
35
35
int j=0 ;
36
36
PyObject** _data = self->_dynamic_one_dimensional_array ->_one_dimensional_array ->_data ; // Check this line
37
- for (int i=0 ; i<=self->_last_pos_filled ;i++){
37
+ for (int i=0 ; i<=self->_dynamic_one_dimensional_array -> _last_pos_filled ;i++){
38
38
if (_data[i] != Py_None){ // Check this line. Python code: if self[i] is not None:
39
39
Py_INCREF (Py_None); // This was put in DynamicOneDimensionalArray line 116
40
40
arr_new[j] = _data[i];
You can’t perform that action at this time.
0 commit comments