narrow: Directly access recipient_id from Stream object.

We previously used to access the whole recipient object
unnecessarily in NarrowBuilder.by_stream code when only
ID was needed.
This commit is contained in:
Sahil Batra 2023-07-21 15:35:49 +05:30 committed by Tim Abbott
parent 91a58d026b
commit 537ecbab45
1 changed files with 3 additions and 3 deletions

View File

@ -435,9 +435,9 @@ class NarrowBuilder:
cond = column("recipient_id", Integer).in_(recipient_ids)
return query.where(maybe_negate(cond))
recipient = stream.recipient
assert recipient is not None
cond = column("recipient_id", Integer) == recipient.id
recipient_id = stream.recipient_id
assert recipient_id is not None
cond = column("recipient_id", Integer) == recipient_id
return query.where(maybe_negate(cond))
def by_streams(self, query: Select, operand: str, maybe_negate: ConditionTransform) -> Select: