summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorik Schellekens <joriks@matrix.org>2019-08-05 13:48:09 +0100
committerJorik Schellekens <joriks@matrix.org>2019-08-05 13:48:09 +0100
commite7f42857bbb191140bd9985dd50ce76ad7fd7e3a (patch)
tree6de9595dc9dbd62edf48835156028407d5736254
parentNicer use of dict update methods. (diff)
downloadsynapse-e7f42857bbb191140bd9985dd50ce76ad7fd7e3a.tar.xz
Refactor return value so we don't create identical lists each time.
-rw-r--r--synapse/handlers/device.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index 4fef2aef0c..ff198d0a3e 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -216,11 +216,11 @@ class DeviceWorkerHandler(BaseHandler):
             possibly_joined = []
             possibly_left = []
 
-        opentracing.log_kv(
-            {"changed": list(possibly_joined), "left": list(possibly_left)}
-        )
+        result = {"changed": list(possibly_joined), "left": list(possibly_left)}
+
+        opentracing.log_kv(result)
 
-        return {"changed": list(possibly_joined), "left": list(possibly_left)}
+        return {result}
 
 
 class DeviceHandler(DeviceWorkerHandler):