diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-03-02 09:53:00 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-03-02 09:53:00 +0000 |
commit | ebc48306662cf8719a0ea64e2955bf8d5e037a8e (patch) | |
tree | 03f5abd35873684edb0e624c195d279de622b21c /synapse/storage/stream.py | |
parent | PEP8 (diff) | |
download | synapse-ebc48306662cf8719a0ea64e2955bf8d5e037a8e.tar.xz |
PR tweaks: set earlier on and use 'as json' for compat
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/stream.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py index 09417bd147..bad427288d 100644 --- a/synapse/storage/stream.py +++ b/synapse/storage/stream.py @@ -43,7 +43,7 @@ from synapse.util.logutils import log_function from collections import namedtuple import logging -import simplejson +import simplejson as json logger = logging.getLogger(__name__) @@ -178,7 +178,7 @@ class StreamStore(SQLBaseStore): # interested in was invited to a room. We'll be passing this # through _get_events_txn later, so ignore the fact that this # may be a redacted event. - event_content = simplejson.loads(row["unrecognized_keys"]) + event_content = json.loads(row["unrecognized_keys"]) if (service.is_interested_in_user( event_content.get("state_key"))): return True @@ -202,7 +202,7 @@ class StreamStore(SQLBaseStore): self._set_before_and_after(ret, rows) if rows: - key = "s%d" % max([r["stream_ordering"] for r in rows]) + key = "s%d" % max(r["stream_ordering"] for r in rows) else: # Assume we didn't get anything because there was nothing to @@ -271,7 +271,7 @@ class StreamStore(SQLBaseStore): self._set_before_and_after(ret, rows) if rows: - key = "s%d" % max([r["stream_ordering"] for r in rows]) + key = "s%d" % max(r["stream_ordering"] for r in rows) else: # Assume we didn't get anything because there was nothing to |