Skip to content

Replace Dictionary with HashSet#2033

Merged
slozier merged 3 commits intoIronLanguages:mainfrom
BCSharp:dictionary_to_set_ipy
Apr 3, 2026
Merged

Replace Dictionary with HashSet#2033
slozier merged 3 commits intoIronLanguages:mainfrom
BCSharp:dictionary_to_set_ipy

Conversation

@BCSharp
Copy link
Copy Markdown
Member

@BCSharp BCSharp commented Apr 3, 2026

This is the equivalent of IronLanguages/dlr#322 on the IronPython side. Maybe HashSet did not exist yet when this code was written.

It is a very opportunistic and straightforward change. Perhaps more possibilities for optimizations exist. One such place is FunctionCode.cs, which contains class PythonDebuggingPayload.TracingWalker. It defines several dictionaries where the value is bool. They look like sets, if the value is always, true, false, or ignored. Maybe this can be simplified somehow or maybe it is unfinished work, but will require more code analysis than what I am doing here for such a mechanical upgrade. Besides, this seems to be used only for debugging/tracing, when performance is not that important.

Copy link
Copy Markdown
Contributor

@slozier slozier left a comment

Choose a reason for hiding this comment

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

Thanks!

@slozier slozier merged commit 914002a into IronLanguages:main Apr 3, 2026
26 checks passed
@BCSharp BCSharp deleted the dictionary_to_set_ipy branch April 3, 2026 22:52
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