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

moonbitlang / core / 6874
89%

Build:
DEFAULT BRANCH: main
Ran 27 Sep 2026 01:57PM UTC
Jobs 1
Files 451
Run time 1min
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

27 Sep 2026 01:53PM UTC coverage: 89.425% (-0.002%) from 89.427%
6874

push

github

bobzhang
fix(builtin,hashmap): let get_or_init/update callbacks write to the map

Map::get_or_init, Map::update, Map::update_or_default and their
@hashmap.HashMap counterparts probed for the key's slot and then called the
user callback, reusing the slot afterwards. A callback that writes to the
same map (memoization is the common case) could leave that slot stale, so
the new entry was written over a live one, behind an emptied slot, or with
a pre-grow mask; `update` could shift back an unrelated slot; and a value
returned for a key the callback removed was written into a detached entry.

- Miss path (`get_or_init`, `update` with `f(None)`): call the callback
  first, then insert with a fresh probe (`set_with_hash`). The extra probe
  is paid on the miss path only.
- Hit path (`update`, `update_or_default`): after `f` returns, the entry is
  used in place only if the (re-masked) slot still holds that same entry
  object; otherwise the result is applied with `set_with_hash` /
  `remove_with_hash`. Comparing sizes would not do: a remove plus an insert
  keeps the size.

The callback's result now wins: it is stored under `key`, replacing any
value the callback stored there itself, and `None` from `update` removes a
key that was present when `f` was called. Doc comments say so.

Signed-off-by: Codex CLI <codex@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

51 of 51 new or added lines in 2 files covered. (100.0%)

16650 of 18619 relevant lines covered (89.42%)

332326.19 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6874.1 27 Sep 2026 01:57PM UTC 451
89.42
GitHub Action Run
Source Files on build 6874
  • Tree
  • List 451
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7e3a8ca1 on github
  • Prev Build on main (#6862)
  • Next Build on main (#6875)
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