Skip to content

Conversation

Susmita331
Copy link

Brief description of what is fixed or changed

  • Fixed an edge case where _last_pos_filled could incorrectly stop at the last occupied index and miss earlier valid elements.
  • Previously, _last_pos_filled was determined using i = -1 and scanning backward, which failed in cases where the last valid element wasn’t at the highest index.
  • The function now starts from self._size - 1 and scans properly, ensuring that all valid elements are preserved before shrinking the array.

Other comments

  • Tested with multiple scenarios, including cases where valid elements were scattered across _data.
  • Future improvements: Optimize _modify() to avoid unnecessary iterations and improve performance.
  • Maintainers' feedback is welcome if further refinements are needed.

@Susmita331 Susmita331 closed this Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants