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

simplify joinResults #2994

Merged
merged 6 commits into from
Dec 18, 2017
Merged

simplify joinResults #2994

merged 6 commits into from
Dec 18, 2017

Conversation

rade
Copy link
Member

@rade rade commented Dec 17, 2017

A bunch of refactoring, tidying up, simplification and a tiny bit of optimisation.

rade added 6 commits December 17, 2017 18:14
fixupAdjacencies fixes up adjancencies of mapped nodes. The nodes at
the call sites we are removing aren't mapped.
Avoid a reduce step by joining the host topology in endpoints2Hosts.

This is similar to what we do in connectionJoin and
endpoints2Processes.
Instead of copying unmatched nodes at the end, and matched nodes when
we encounter them, copy *all* nodes at the beginning.
Since we seed the joinResult with the nodes from the topology we are
mapping to, we know the 'create' function is only called when there is
no node with the specified id.

This neatly makes the 'create' function only do what it says,
i.e. return _new_ nodes.
Any existing list would be mutated by result(), which is bad.

Note that all the existing newJoinResults() call sites pass in nodes
with no adjacencies, so this is purely a safety measure.
@rade rade requested a review from bboreham December 17, 2017 18:26
@rade rade merged commit e2b1bfb into master Dec 18, 2017
@rade rade deleted the simplify-join-results branch December 25, 2017 10:15
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