feat(data-structures/unstable): add includes() and removeAt() to Deque#7083
feat(data-structures/unstable): add includes() and removeAt() to Deque#7083bartlomieju merged 4 commits intodenoland:mainfrom
includes() and removeAt() to Deque#7083Conversation
Dequeincludes() and removeAt() to Deque
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7083 +/- ##
=======================================
Coverage 94.42% 94.42%
=======================================
Files 630 630
Lines 50533 50546 +13
Branches 8964 8964
=======================================
+ Hits 47717 47730 +13
Misses 2247 2247
Partials 569 569 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bartlomieju
left a comment
There was a problem hiding this comment.
Thanks for the PR! includes() and removeAt() are good additions, and the refactoring (#maybeGrow, #removeAtUnchecked) is clean. The complexity table is a nice touch.
A few high-level points beyond the inline comments:
PR scope is broad
This bundles four concerns: new features (includes, removeAt), docs (complexity table), perf optimizations (iterator rewrite, toArray/#copyBuffer/from() changes), and refactoring (#maybeGrow, #removeAtUnchecked). I'd suggest splitting the perf optimizations into a separate PR — they have different risk profiles and the iterator behavior change in particular deserves focused review.
Codecov flags 4 uncovered lines
The coverage report shows 3 missing + 1 partial line in unstable_deque.ts. Worth checking which lines those are and adding test coverage.
|
Thanks. I've reverted the perf tweaks. Will consider a secondary PR for those. |
includes()method (matchingArray.prototype.includes), andremoveAt(index)for removing elements by index with negative-index support.BinaryHeapdocs.#maybeGrow()and#removeAtUnchecked()private helpers to reduce duplication