Skip to content

✨ feat(mq-lang): add indices builtin for finding all occurrence positions - #2226

Merged
harehare merged 1 commit into
mainfrom
feat/indices-builtin
Aug 19, 2026
Merged

✨ feat(mq-lang): add indices builtin for finding all occurrence positions#2226
harehare merged 1 commit into
mainfrom
feat/indices-builtin

Conversation

@harehare

Copy link
Copy Markdown
Owner

Summary

index/rindex only return the first or last match. indices(arr_or_str, needle) returns all match positions as an array, replacing the ad-hoc foreach+range+compact idiom for string, bytes, and array haystacks.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation
  • ⚡ Performance
  • ✅ Test
  • 📦 Build / dependencies
  • 👷 CI

Checklist

  • I ran cargo fmt and cargo clippy and addressed any warnings
  • I ran just test-all and all tests pass
  • I added or updated tests covering this change
  • I updated relevant documentation (/docs, crate README.md) if needed
  • I added a changelog entry if this is a user-facing change

Additional Context

…ions

index/rindex only return the first or last match. indices(arr_or_str, needle)
returns all match positions as an array, replacing the ad-hoc
foreach+range+compact idiom for string, bytes, and array haystacks.
@codspeed-hq

codspeed-hq Bot commented Aug 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing feat/indices-builtin (6764c42) with main (3798621)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (3c7d556) during the generation of this report, so 3798621 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@harehare
harehare merged commit a7b2b79 into main Aug 19, 2026
12 checks passed
@harehare
harehare deleted the feat/indices-builtin branch August 19, 2026 23:40
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.

1 participant