Skip to content

Commit 4c6540b

Browse files
committed
options(refactor[convert_values]): Remove dead SparseArray branch
why: The SparseArray-specific branch at lines 248-251 was unreachable dead code. Since SparseArray inherits from dict, isinstance(value, dict) returns True and the dict branch handles it correctly first. what: - Remove unreachable SparseArray branch that contained buggy logic - Add comment explaining dict branch handles SparseArray too
1 parent f7d65ad commit 4c6540b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/libtmux/options.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,10 @@ def convert_values(
242242
if value is None:
243243
return None
244244
if isinstance(value, dict):
245+
# Note: SparseArray inherits from dict, so this branch handles both
245246
for k, v in value.items():
246247
value[k] = convert_value(v)
247248
return value
248-
if isinstance(value, SparseArray):
249-
for v in value.iter_values():
250-
value[v] = convert_value(v)
251-
return value
252249
if isinstance(value, list):
253250
for idx, v in enumerate(value):
254251
value[idx] = convert_value(v)

0 commit comments

Comments
 (0)