Skip to content

[Utilities.CleverDicts] add identity storage mode - #3117

Open
blegat wants to merge 2 commits into
masterfrom
bl/clever_dict_identity
Open

blegat wants to merge 2 commits into
masterfrom
bl/clever_dict_identity

Conversation

@blegat

@blegat blegat commented Oct 27, 2026

Copy link
Copy Markdown
Member

@joaquimg and I have wanted this for years, Opus 5.5 finally gives it to us. Most of the time, the variable mapping is trivial so CleverDict don't even need to store a Vector.

When K == V and the dict maps the keys of indices 1:n to themselves, only n is
recorded and no backing storage is used. This is typically the case for the
variable map of an IndexMap when the destination creates its variables in the
same order as the source.
A return value of `false` does not imply that `c` is not the identity, for
example, if a key was deleted and then set back again.
"""
is_identity(c::CleverDict) = c.is_identity

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just keep this internal?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He wants it public for #3118

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants