Explain why we're prefilling dict with Nones

pull/219/head
Erik Johnston 2015-08-12 17:16:30 +01:00
parent 101ee3fd00
commit c10ac7806e
1 changed files with 4 additions and 0 deletions

View File

@ -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