We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed88315 commit 3613556Copy full SHA for 3613556
pydatastructs/linear_data_structures/arrays.py
@@ -380,10 +380,10 @@ def _modify(self, force=False):
380
below load factor.
381
"""
382
if force:
383
- i = -1
384
- while self._data[i] is None:
+ i = self._size - 1
+ while i >= 0 and self._data[i] is None:
385
i -= 1
386
- self._last_pos_filled = i%self._size
+ self._last_pos_filled = i
387
if (self._num/self._size < self._load_factor):
388
arr_new = OneDimensionalArray(self._dtype, 2*self._num + 1)
389
j = 0
0 commit comments