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

Make the order of linking of ports deterministic #21995

Merged
merged 1 commit into from
May 27, 2024

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented May 24, 2024

In python dict() ordering is deterministic, but set() ordering is not. Annoying.

This change adds a simple OrderedSet and uses that for managing ports.

Fixes: #21930

In python `dict()` ordering is deterministic, but `set()` ordering is
not.  Annoying.

This change adds a simple `OrderedSet` and uses that for managing ports.

Fixes: emscripten-core#21930
@sbc100 sbc100 requested review from kripken and tlively May 24, 2024 01:05
@sbc100 sbc100 enabled auto-merge (squash) May 24, 2024 22:34
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

Wow, that is annoying.

Comment on lines +375 to +377
self.dict = dict()
for i in items:
self.dict[i] = True
Copy link
Member

Choose a reason for hiding this comment

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

This could be shortened:

Suggested change
self.dict = dict()
for i in items:
self.dict[i] = True
self.dict = {item: True for item in items}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops, will followup.

@sbc100 sbc100 merged commit e2a0472 into emscripten-core:main May 27, 2024
29 checks passed
@sbc100 sbc100 deleted the port_ordering branch May 27, 2024 04:10
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.

Randomly occurring libpng bug in png_read_IDAT_data
2 participants