mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-19 08:14:11 -04:00
Run Black. (#5482)
This commit is contained in:
parent
7dcf984075
commit
32e7c9e7f2
376 changed files with 9142 additions and 10388 deletions
|
@ -77,9 +77,8 @@ class StreamChangeCache(object):
|
|||
|
||||
if stream_pos >= self._earliest_known_stream_pos:
|
||||
changed_entities = {
|
||||
self._cache[k] for k in self._cache.islice(
|
||||
start=self._cache.bisect_right(stream_pos),
|
||||
)
|
||||
self._cache[k]
|
||||
for k in self._cache.islice(start=self._cache.bisect_right(stream_pos))
|
||||
}
|
||||
|
||||
result = changed_entities.intersection(entities)
|
||||
|
@ -114,8 +113,10 @@ class StreamChangeCache(object):
|
|||
assert type(stream_pos) is int
|
||||
|
||||
if stream_pos >= self._earliest_known_stream_pos:
|
||||
return [self._cache[k] for k in self._cache.islice(
|
||||
start=self._cache.bisect_right(stream_pos))]
|
||||
return [
|
||||
self._cache[k]
|
||||
for k in self._cache.islice(start=self._cache.bisect_right(stream_pos))
|
||||
]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
@ -136,7 +137,7 @@ class StreamChangeCache(object):
|
|||
while len(self._cache) > self._max_size:
|
||||
k, r = self._cache.popitem(0)
|
||||
self._earliest_known_stream_pos = max(
|
||||
k, self._earliest_known_stream_pos,
|
||||
k, self._earliest_known_stream_pos
|
||||
)
|
||||
self._entity_to_key.pop(r, None)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue