• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 5796 / 1
90%
main: 90%

Build:
DEFAULT BRANCH: main
Ran 07 Aug 2026 02:59AM UTC
Files 464
Run time 10s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Aug 2026 02:57AM UTC coverage: 90.337% (+0.009%) from 90.328%
5796.1

push

github

bobzhang
perf(string): back code unit range comparison with %string.unsafe_range_equal

Add a private `String::unsafe_range_equal` primitive, annotated with
`#intrinsic("%string.unsafe_range_equal")` and `#borrow`, mirroring the
existing `Bytes::unsafe_range_equal`. The MoonBit body is the fallback for
backends without the intrinsic; on native it lowers to a single `memcmp`.

Route the hand-rolled code unit loops through it: `StringView::has_prefix`,
`StringView::has_suffix`, `Eq for StringView` and
`StringView::equal_to_string`.

`has_prefix`/`has_suffix` compare the anchor code unit inline before the
call, because rejecting there is the common case and is cheaper than the
range-compare call overhead.

The `find`/`rev_find` two-anchor middle check is deliberately left on the
inline early-exit loop: its ranges are short and usually mismatch early, so
the call overhead dominates.

16257 of 17996 relevant lines covered (90.34%)

168468.12 hits per line

Source Files on job 5796.1
  • Tree
  • List 464
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5796
  • d7c68d07 on github
  • Prev Job for on main (#5794.1)
  • Next Job for on main (#5798.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc