From a7d9ad034577501887385ed927261a3c7ebbeaa3 Mon Sep 17 00:00:00 2001 From: Rich Chiodo false Date: Wed, 1 May 2024 11:33:23 -0700 Subject: [PATCH] Review feedback --- src/debugpy/common/util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/debugpy/common/util.py b/src/debugpy/common/util.py index e9555972..603918e8 100644 --- a/src/debugpy/common/util.py +++ b/src/debugpy/common/util.py @@ -167,6 +167,7 @@ def hide_thread_from_debugger(thread): thread.pydev_do_not_trace = True thread.is_pydev_daemon_thread = True + class IDMap(object): def __init__(self): @@ -186,9 +187,8 @@ class IDMap(object): self._value_to_key[value] = key return key + def contains_line(code: CodeType, line: int) -> bool: - for co_line in code.co_lines(): - if len(co_line) == 3: - if co_line[2] == line: - return True - return False \ No newline at end of file + return any( + (len(co_line) == 3 and co_line[2] == line for co_line in code.co_lines()) + )