Add a cache to _verify_event_type_length_or_raise (#116312)
Most of the time the events being fired are the same so we can skip the python code in this function
This commit is contained in:
parent
9fb01f3956
commit
50405fae5f
1 changed files with 1 additions and 0 deletions
|
@ -1408,6 +1408,7 @@ class _OneTimeListener(Generic[_DataT]):
|
|||
EMPTY_LIST: list[Any] = []
|
||||
|
||||
|
||||
@functools.lru_cache
|
||||
def _verify_event_type_length_or_raise(event_type: EventType[_DataT] | str) -> None:
|
||||
"""Verify the length of the event type and raise if too long."""
|
||||
if len(event_type) > MAX_LENGTH_EVENT_EVENT_TYPE:
|
||||
|
|
Loading…
Add table
Reference in a new issue