Skip to content

Commit 3b32313

Browse files
change equality condition
1 parent c9363e6 commit 3b32313

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

pythonbpf/vmlinux_parser/dependency_node.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,9 @@ def __hash__(self):
3939
def __eq__(self, other):
4040
"""
4141
Define equality consistent with the hash function.
42-
Two fields are equal if they have the same name, type, and offset.
42+
Two fields are equal if they have they are the same
4343
"""
44-
# DO ther change here
45-
if not isinstance(other, Field):
46-
return False
47-
48-
return (
49-
self.name == other.name
50-
and self.type is other.type
51-
and self.ctype_complex_type is other.ctype_complex_type
52-
and self.containing_type is other.containing_type
53-
and self.type_size == other.type_size
54-
and self.bitfield_size == other.bitfield_size
55-
and self.offset == other.offset
56-
and self.value == other.value
57-
)
44+
return self is other
5845

5946
def set_ready(self, is_ready: bool = True) -> None:
6047
"""Set the readiness state of this field."""

0 commit comments

Comments
 (0)