Skip to content

stdune: add Map.is_singleton - #16533

Merged
anmonteiro merged 1 commit into
ocaml:mainfrom
anmonteiro:stdune/map-is-singleton
Oct 4, 2026
Merged

anmonteiro merged 1 commit into
ocaml:mainfrom
anmonteiro:stdune/map-is-singleton

Conversation

@anmonteiro

Copy link
Copy Markdown
Collaborator

Add a portable singleton check to Stdune.Map, with tests. Preparation for #16498.

Check for a singleton by short-circuiting after the second binding, without depending on the OCaml 5.5 API. Cover empty and singleton maps, larger trees, replacement, and removal.

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
@anmonteiro
anmonteiro merged commit 4f0e977 into ocaml:main Oct 4, 2026
36 of 37 checks passed
@anmonteiro
anmonteiro deleted the stdune/map-is-singleton branch October 4, 2026 22:28
anmonteiro added a commit that referenced this pull request Oct 4, 2026
Use Map.is_singleton for the single-context fallback in runtest.
Follow-up to #16533.

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro added a commit that referenced this pull request Oct 4, 2026
Add the compatible singleton check to the bootstrap map wrapper and
avoid full cardinality scans. Follow-up to #16533.

Signed-off-by: Antonio Nuno Monteiro <[email protected]>
@Alizter Alizter added this to the 3.26.0 milestone Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants