Skip to content

Preserve history visibility in HeaderedReverseTopologicalOrdering #327

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

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

S7evinK
Copy link
Collaborator

@S7evinK S7evinK commented Aug 1, 2022

This preserves the history visibility when using HeaderedReverseTopologicalOrdering, otherwise incremental syncs in Dendrite can't check the visibility of an event.

@S7evinK S7evinK requested a review from neilalexander August 1, 2022 08:32
@@ -231,13 +231,16 @@ func ReverseTopologicalOrdering(input []*Event, order TopologicalOrder) []*Event
func HeaderedReverseTopologicalOrdering(events []*HeaderedEvent, order TopologicalOrder) []*HeaderedEvent {
r := stateResolverV2{}
input := make([]*Event, len(events))
hisVis := make(map[string]HistoryVisibility)
Copy link
Contributor

Choose a reason for hiding this comment

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

We know the capacity here ahead of time as len(events) so please give that to make() to reduce the number of allocations.

@S7evinK S7evinK merged commit 5ff38e2 into main Aug 1, 2022
@S7evinK S7evinK deleted the s7evink/historyvisibility branch August 1, 2022 08:38
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