Remove _get_poll lookup in Message constructor

This was triggering a terrible performance regression for no good
reason for all created messages that didn't have a poll, which is
essentially 99.99% of messages leading to MESSAGE_CREATE dispatches
having degraded performance.
This commit is contained in:
Rapptz
2024-08-31 08:29:05 -04:00
parent dee5bf65c6
commit 733c583b72
3 changed files with 1 additions and 12 deletions

View File

@ -721,11 +721,6 @@ class _WebhookState:
return self._parent._get_guild(guild_id)
return None
def _get_poll(self, msg_id: Optional[int]) -> Optional[Poll]:
if self._parent is not None:
return self._parent._get_poll(msg_id)
return None
def store_user(self, data: Union[UserPayload, PartialUserPayload], *, cache: bool = True) -> BaseUser:
if self._parent is not None:
return self._parent.store_user(data, cache=cache)