Skip to content

Make take_map and restricting ignore empty materialised nodes - #183

Merged
imlvts merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/take-map-restricting-empty-focus
Nov 4, 2026
Merged

imlvts merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/take-map-restricting-empty-focus

Conversation

@imlvts

@imlvts imlvts commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

At a focus with nothing below it, these answered according to whether an empty node happened to exist there (after create_path or remove_val, say) rather than according to the trie's paths and values:

  • take_map returned Some(empty map) instead of None, and for a focus holding only a value it returned a map whose root node was that empty node, which panicked on the first write below the root ("make_unique on an empty sentinel node");
  • restricting with a dangling source focus erased the destination's branches and returned true; either side with nothing below its focus now leaves the destination alone and returns false, as it already did for a source focus that does not exist.

At a focus with nothing below it, these answered according to whether an
empty node happened to exist there (after create_path or remove_val, say)
rather than according to the trie's paths and values:
- take_map returned Some(empty map) instead of None, and for a focus
  holding only a value it returned a map whose root node was that empty
  node, which panicked on the first write below the root ("make_unique on
  an empty sentinel node");
- restricting with a dangling source focus erased the destination's
  branches and returned true; either side with nothing below its focus
  now leaves the destination alone and returns false, as it already did
  for a source focus that does not exist.
@Adam-Vandervorst

Copy link
Copy Markdown
Owner

LGTM!

@imlvts
imlvts merged commit 9fa22a5 into Adam-Vandervorst:master Nov 4, 2026
5 checks passed
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