Commit d18698ac authored by Rohit Kumar Singh's avatar Rohit Kumar Singh Committed by Sébastien Bourdeauducq
Browse files

Implement __contains__() method for _ClockDomainList class

Fixes #66 issue which resulted in creation of redundant
clock domains
parent ca3cde6a
...@@ -695,6 +695,15 @@ class _ClockDomainList(list): ...@@ -695,6 +695,15 @@ class _ClockDomainList(list):
else: else:
return list.__getitem__(self, key) return list.__getitem__(self, key)
def __contains__(self, cd_or_name):
if isinstance(cd_or_name, str):
for cd in self:
if cd.name == cd_or_name:
return True
return False
else:
return list.__contains__(self, cd_or_name)
(SPECIAL_INPUT, SPECIAL_OUTPUT, SPECIAL_INOUT) = range(3) (SPECIAL_INPUT, SPECIAL_OUTPUT, SPECIAL_INOUT) = range(3)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment