Skip to content

feat(collections/unstable): accept Iterable in interleave#7088

Open
tomas-zijdemans wants to merge 2 commits intodenoland:mainfrom
tomas-zijdemans:interleave-perf
Open

feat(collections/unstable): accept Iterable in interleave#7088
tomas-zijdemans wants to merge 2 commits intodenoland:mainfrom
tomas-zijdemans:interleave-perf

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

interleave now widens the API to Iterable without extra cost for array callers. This is in line with the general direction of the collections module. interleave is very close to zip that does not support Iterable, but looking at the module as a whole, I think it's zip that needs to change.

Also added a two-array fast path (no inner loop, no per-pair bounds check) and a branch for equal-length inputs where the length guard is unnecessary. This should help with two very common use cases. The general unequal-length path is unchanged.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.41%. Comparing base (1cd63ca) to head (b9a16ff).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7088   +/-   ##
=======================================
  Coverage   94.41%   94.41%           
=======================================
  Files         630      630           
  Lines       50490    50518   +28     
  Branches     8949     8959   +10     
=======================================
+ Hits        47669    47698   +29     
  Misses       2249     2249           
+ Partials      572      571    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant