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

feat: NodePortDictionary serialize keys and value lists directly to retain port order. #314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LukeStampfli
Copy link

Changes NodePortDictionary to keep port order. Dictionary does not guarantee order, with the current implementation when adding dynamic ports and then clearing them and adding them again ports will end up being in a different order.

Changes in this PR:

  • NodePortDictionary no longer inherits from Dictionary
  • NodePortDictionary serializes keys and values lists directly instead of rebuilding them from the dictionary.
  • NodePortDictionary.Values/Keys now accesses the value list which is based on insertion order instead of the dictionary values.
  • Removal now technically runs in O(n), but shouldn't be a performance problem here.

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.

1 participant