Skip to content

feat(builtin): add ArrayView::search_by#3429

Merged
bobzhang merged 1 commit into
mainfrom
hongbo/ArrayView_search_by
Apr 15, 2026
Merged

feat(builtin): add ArrayView::search_by#3429
bobzhang merged 1 commit into
mainfrom
hongbo/ArrayView_search_by

Conversation

@bobzhang
Copy link
Copy Markdown
Contributor

@bobzhang bobzhang commented Apr 15, 2026

Summary

  • Mirror Array::search_by on ArrayView, returning the view-relative index of the first element satisfying the predicate.
  • Complements the existing Eq-based ArrayView::search.

Test plan

  • moon fmt, moon check, moon info
  • moon test -p moonbitlang/core/builtin — 2740/2740 pass
  • New tests: basic, no-match, empty view, first-match stop, view-relative index on sliced view, match-first-element.

🤖 Generated with Claude Code


Open with Devin

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 15, 2026

Coverage Report for CI Build 3796

Coverage increased (+0.001%) to 95.005%

Details

  • Coverage increased (+0.001%) from the base build.
  • Patch coverage: 4 of 4 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15436
Covered Lines: 14665
Line Coverage: 95.01%
Coverage Strength: 219947.41 hits per line

💛 - Coveralls

Mirror Array::search_by on ArrayView, returning the view-relative index of
the first element satisfying the predicate, or None. Complements the
existing Eq-based ArrayView::search.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bobzhang bobzhang force-pushed the hongbo/ArrayView_search_by branch from 2271f48 to 02f2691 Compare April 15, 2026 03:56
@bobzhang bobzhang merged commit fba0da0 into main Apr 15, 2026
15 checks passed
@bobzhang bobzhang deleted the hongbo/ArrayView_search_by branch April 15, 2026 05:41
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