From fe2c9b2b16a1b4b97009c84b268ddd4c445faaa7 Mon Sep 17 00:00:00 2001 From: Josh Watson Date: Tue, 6 Nov 2018 11:05:39 -0800 Subject: Added __eq__ to MediumLevelILOperationAndSize as well --- python/mediumlevelil.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/mediumlevelil.py') diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 103d8c5f..f35b2e6e 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -71,6 +71,12 @@ class MediumLevelILOperationAndSize(object): return "<%s>" % self.operation.name return "<%s %d>" % (self.operation.name, self.size) + def __eq__(self, other): + if isinstance(other, MediumLevelILOperation): + return other == self.operation + if isinstance(other, MediumLevelILOperationAndSize): + return other.size == self.size and other.operation == self.operation + class MediumLevelILInstruction(object): """ -- cgit v1.3.1