Skip to content

Commit b6ae524

Browse files
committed
[Examples] Move structured-data unpacking out of the loop. (NFC)
There's no need to repeat this work in the loop.
1 parent 1b099c1 commit b6ae524

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/examples/python/in_call_stack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ def __lldb_init_module(debugger, internal_dict):
99

1010
def in_call_stack(frame, bp_loc, arg_dict, _):
1111
"""Only break if the given name is in the current call stack."""
12+
name = arg_dict.GetValueForKey('name').GetStringValue(1000)
1213
thread = frame.GetThread()
1314
found = False
1415
for frame in thread.frames:
15-
name = arg_dict.GetValueForKey('name').GetStringValue(1000)
1616
# Check the symbol.
1717
symbol = frame.GetSymbol()
1818
if symbol and name in frame.GetSymbol().GetName():

0 commit comments

Comments
 (0)