Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set<Mixed>, Lst<Mixed> do not hide unresolved links well #5215

Closed
ironage opened this issue Feb 2, 2022 · 0 comments · Fixed by #5418
Closed

Set<Mixed>, Lst<Mixed> do not hide unresolved links well #5215

ironage opened this issue Feb 2, 2022 · 0 comments · Fixed by #5418
Assignees
Labels

Comments

@ironage
Copy link
Contributor

ironage commented Feb 2, 2022

While testing collections of links, I found a difference in behaviour between removing an object and invalidating it. LnkLst/LnkSet hide invalidated links but Lst<Mixed> and Set<Mixed> do not have this capability. If a link in these collections is invalidated it becomes null and the size of the collection is not changed. Furthermore, the stored link is not a true null because operations like find_first(Mixed{}) will return not found.

T link_collection = {object};

T                   object.invalidate()     object.remove()
LnkLst              {}                      {}
Lst<Mixed>          {null} <--*             {}
LnkSet              {}                      {}
Set<Mixed>          {null} <--*             {}
Dictionary<Object>  {key:null}              {key:null}
Dictionary<Mixed>   {key:null}              {key:null}

I think the easiest thing to do here is to remove the links from these collections instead of storing a link to the invalidated object.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants