Convert list comprehension to generator when using any()
This commit is contained in:
parent
617a53e196
commit
0826959984
1 changed files with 1 additions and 2 deletions
|
@ -81,8 +81,7 @@ class Trace(Action):
|
||||||
@classmethod
|
@classmethod
|
||||||
def has_profiling_events(cls, events_ust: List[str]) -> bool:
|
def has_profiling_events(cls, events_ust: List[str]) -> bool:
|
||||||
"""Check if the UST events list contains at least one profiling event."""
|
"""Check if the UST events list contains at least one profiling event."""
|
||||||
matches = [re.match(cls.PROFILE_EVENT_PATTERN, event_name) for event_name in events_ust]
|
return any(re.match(cls.PROFILE_EVENT_PATTERN, event_name) for event_name in events_ust)
|
||||||
return any(matches)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_shared_lib_path(lib_name: str) -> Union[str, None]:
|
def get_shared_lib_path(lib_name: str) -> Union[str, None]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue