From 3b323132f04d409e3889ced6c862533ba4e92a87 Mon Sep 17 00:00:00 2001 From: varun-r-mallya Date: Mon, 20 Oct 2025 21:29:04 +0530 Subject: [PATCH] change equality condition --- pythonbpf/vmlinux_parser/dependency_node.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/pythonbpf/vmlinux_parser/dependency_node.py b/pythonbpf/vmlinux_parser/dependency_node.py index 5055b32..dd413ad 100644 --- a/pythonbpf/vmlinux_parser/dependency_node.py +++ b/pythonbpf/vmlinux_parser/dependency_node.py @@ -39,22 +39,9 @@ class Field: def __eq__(self, other): """ Define equality consistent with the hash function. - Two fields are equal if they have the same name, type, and offset. + Two fields are equal if they have they are the same """ - # DO ther change here - if not isinstance(other, Field): - return False - - return ( - self.name == other.name - and self.type is other.type - and self.ctype_complex_type is other.ctype_complex_type - and self.containing_type is other.containing_type - and self.type_size == other.type_size - and self.bitfield_size == other.bitfield_size - and self.offset == other.offset - and self.value == other.value - ) + return self is other def set_ready(self, is_ready: bool = True) -> None: """Set the readiness state of this field."""