Closed tuhm1 closed 1 month ago
@ds300 Do you recommend landing this change? Does it overlap with/obviate #24?
@littledan yeah this is good to land I think. The other PR should be closed, it adds some dubious sanity checks but doesn't fix any bugs as far as I can tell (actually it seems to add code that would swallow legitimate errors in some cases).
@ds300 Just to clarify, I've tested these changes thoroughly, and they don't introduce any new issues. These sanity checks are not meant to hide real errors but to prevent the feature from breaking when it encounters unusual situations.
Fixes #2
The issue arises when removing an element, which shifts the last element to the current index. As a result, the last index goes out of bounds, and the moved element remains unprocessed.
To address this, iterate backward so that the removed element is replaced with a checked element, while the others remain unchanged.