mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +00:00
utils/types: fix toggle_set merge methods
- The merge_with and merge_into implementation was reversed. Fix this, so that it is implemented correctly, i.e. that a.merge_with(b) === merge(a, b) a.merge_into(b) === merge(b, a) - Ensure that in case of merge_into(), a toggle_set is always returned.
This commit is contained in:
parent
5b03ac3afd
commit
9093477f1b
@ -390,12 +390,12 @@ class toggle_set(set):
|
||||
set.__init__(self, *args)
|
||||
|
||||
def merge_with(self, other):
|
||||
new_self = copy(self)
|
||||
return toggle_set.merge(other, new_self)
|
||||
other = copy(other)
|
||||
return toggle_set.merge(self, toggle_set(other))
|
||||
|
||||
def merge_into(self, other):
|
||||
other = copy(other)
|
||||
return toggle_set.merge(self, other)
|
||||
new_self = copy(self)
|
||||
return toggle_set.merge(other, new_self)
|
||||
|
||||
def add(self, item):
|
||||
if item not in self:
|
||||
|
Loading…
x
Reference in New Issue
Block a user