mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Two fixes for the copy ctor/operator=:
1. Make sure to clear() 'this' before adding elements to it 2. Make sure that the leaders of the RHS EC are the leaders of the LHS EC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20692 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6782397046
commit
1f377fefb7
@ -118,11 +118,14 @@ public:
|
||||
}
|
||||
|
||||
const EquivalenceClasses &operator=(const EquivalenceClasses &RHS) {
|
||||
TheMapping.clear();
|
||||
for (iterator I = RHS.begin(), E = RHS.end(); I != E; ++I)
|
||||
if (I->isLeader())
|
||||
insert(I->getData());
|
||||
else
|
||||
unionSets(I->getData(), *RHS.findLeader(I));
|
||||
if (I->isLeader()) {
|
||||
member_iterator MI = RHS.member_begin(I);
|
||||
member_iterator LeaderIt = member_begin(insert(*MI));
|
||||
for (++MI; MI != member_end(); ++MI)
|
||||
unionSets(LeaderIt, member_begin(insert(*MI)));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user