mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Replace loop with std::find.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175366 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
631dd86804
commit
81474e98e1
@ -135,20 +135,14 @@ void SUnit::removePred(const SDep &D) {
|
||||
for (SmallVector<SDep, 4>::iterator I = Preds.begin(), E = Preds.end();
|
||||
I != E; ++I)
|
||||
if (*I == D) {
|
||||
bool FoundSucc = false;
|
||||
// Find the corresponding successor in N.
|
||||
SDep P = D;
|
||||
P.setSUnit(this);
|
||||
SUnit *N = D.getSUnit();
|
||||
for (SmallVector<SDep, 4>::iterator II = N->Succs.begin(),
|
||||
EE = N->Succs.end(); II != EE; ++II)
|
||||
if (*II == P) {
|
||||
FoundSucc = true;
|
||||
N->Succs.erase(II);
|
||||
break;
|
||||
}
|
||||
assert(FoundSucc && "Mismatching preds / succs lists!");
|
||||
(void)FoundSucc;
|
||||
SmallVectorImpl<SDep>::iterator Succ = std::find(N->Succs.begin(),
|
||||
N->Succs.end(), P);
|
||||
assert(Succ != N->Succs.end() && "Mismatching preds / succs lists!");
|
||||
N->Succs.erase(Succ);
|
||||
Preds.erase(I);
|
||||
// Update the bookkeeping.
|
||||
if (P.getKind() == SDep::Data) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user