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

moonbitlang / core / 4351

14 May 2026 01:35AM UTC coverage: 94.275% (+0.003%) from 94.272%
4351

push

github

bobzhang
feat(hashmap): add get_from_bytes / get_from_string to match Map API

`builtin/Map` already supports zero-allocation lookups with a `BytesView` /
`StringView` key (`Map::get_from_bytes`, `Map::get_from_string`). The
unordered `@hashmap.HashMap` had no such pair, so callers had to materialize
an owned `Bytes` / `String` to probe a hash map with view-shaped keys.

This adds the two mirror methods on `HashMap`, with the same probing logic
as `Map`. The cross-type equality helpers used here
(`BytesView::equal_to_bytes`, `StringView::equal_to_string`) come from
the preceding refactor in `builtin`, so no helpers are duplicated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

8 of 10 new or added lines in 1 file covered. (80.0%)

2 existing lines in 1 file now uncovered.

14904 of 15809 relevant lines covered (94.28%)

217231.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.93
/builtin/stringview.mbt


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc