Skip to content

Commit 1c349c8

Browse files
r41k0uclaude
andcommitted
Core: Return the function-pointer check directly in _is_flattenable_scalar
Style only, no behaviour change and no IR change. Keeps `ruff check --select SIM` clean on the files this branch touches. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 0139077 commit 1c349c8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

pythonbpf/vmlinux_parser/class_handler.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ def _is_flattenable_scalar(member_type: Any) -> bool:
5858
return False
5959
if issubclass(member_type, (ctypes._Pointer, ctypes.Array)):
6060
return False
61-
if hasattr(member_type, "_restype_") and hasattr(member_type, "_argtypes_"):
62-
return False
63-
return True
61+
is_function_pointer = hasattr(member_type, "_restype_") and hasattr(
62+
member_type, "_argtypes_"
63+
)
64+
return not is_function_pointer
6465

6566

6667
def flatten_anonymous_members(class_obj, dep_node) -> None:

0 commit comments

Comments
 (0)