mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 16:53:53 +01:00
optimise state copying
This commit is contained in:
parent
193cadc988
commit
54bbe71867
1 changed files with 5 additions and 7 deletions
|
@ -21,7 +21,7 @@ import math
|
|||
import string
|
||||
from collections import OrderedDict
|
||||
|
||||
from six import string_types
|
||||
from six import iteritems, string_types
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
|
@ -237,12 +237,10 @@ class RoomCreationHandler(BaseHandler):
|
|||
# map from event_id to BaseEvent
|
||||
old_room_state_events = yield self.store.get_events(old_room_state_ids.values())
|
||||
|
||||
for k in types_to_copy:
|
||||
old_event_id = old_room_state_ids.get(k)
|
||||
if old_event_id:
|
||||
old_event = old_room_state_events.get(old_event_id)
|
||||
if old_event:
|
||||
initial_state[k] = old_event.content
|
||||
for k, old_event_id in iteritems(old_room_state_ids):
|
||||
old_event = old_room_state_events.get(old_event_id)
|
||||
if old_event:
|
||||
initial_state[k] = old_event.content
|
||||
|
||||
yield self._send_events_for_new_room(
|
||||
requester,
|
||||
|
|
Loading…
Reference in a new issue