Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use .iter* to avoid copies in StateHandler #3006

Merged
merged 2 commits into from
Mar 22, 2018
Merged

Conversation

erikjohnston
Copy link
Member

No description provided.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

looks good modulo the below

synapse/state.py Outdated
}

# if the new state matches any of the input state groups, we can
# use that state group again. Otherwise we will generate a state_id
# which will be used as a cache key for future resolutions, but
# not get persisted.
state_group = None
new_state_event_ids = frozenset(new_state.values())
for sg, events in state_groups_ids.items():
new_state_event_ids = frozenset(new_state.iteritems())
Copy link
Member

Choose a reason for hiding this comment

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

itervalues surely

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch!

@richvdh richvdh assigned erikjohnston and unassigned richvdh Mar 19, 2018
@erikjohnston erikjohnston merged commit 84b5cc6 into develop Mar 22, 2018
@erikjohnston erikjohnston deleted the erikj/state_iter branch September 20, 2018 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants