summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/10421.misc1
-rw-r--r--synapse/storage/databases/main/events.py4
2 files changed, 1 insertions, 4 deletions
diff --git a/changelog.d/10421.misc b/changelog.d/10421.misc
new file mode 100644
index 0000000000..385cbe07af
--- /dev/null
+++ b/changelog.d/10421.misc
@@ -0,0 +1 @@
+Remove unused `events_by_room` code (tech debt).
diff --git a/synapse/storage/databases/main/events.py b/synapse/storage/databases/main/events.py
index ec8579b9ad..a396a201d4 100644
--- a/synapse/storage/databases/main/events.py
+++ b/synapse/storage/databases/main/events.py
@@ -2010,10 +2010,6 @@ class PersistEventsStore:
 
         Forward extremities are handled when we first start persisting the events.
         """
-        events_by_room: Dict[str, List[EventBase]] = {}
-        for ev in events:
-            events_by_room.setdefault(ev.room_id, []).append(ev)
-
         query = (
             "INSERT INTO event_backward_extremities (event_id, room_id)"
             " SELECT ?, ? WHERE NOT EXISTS ("