summary refs log tree commit diff
path: root/synapse/storage/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-12 17:16:30 +0100
committerErik Johnston <erik@matrix.org>2015-08-12 17:16:30 +0100
commitc10ac7806e2cde04f344b641d01efa46d34f9985 (patch)
treecd39d9b0452ce40dfeb794f12a2af582a21e2cb7 /synapse/storage/state.py
parentBetter variable name (diff)
downloadsynapse-c10ac7806e2cde04f344b641d01efa46d34f9985.tar.xz
Explain why we're prefilling dict with Nones
Diffstat (limited to '')
-rw-r--r--synapse/storage/state.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index a3fc859b06..57e334cc3e 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -412,6 +412,10 @@ class StateStore(SQLBaseStore):
 
         for group, state_ids in group_state_dict.items():
             if types:
+                # We delibrately put key -> None mappings into the cache to
+                # cache absence of the key, on the assumption that if we've
+                # explicitly asked for some types then we will probably ask
+                # for them again.
                 state_dict = {
                     key: None
                     for key in types