ScopInfo: Further simplify code

Acc==MA implies Acc->getAccessInstruction() == MA->getAccessInstruction().

Suggested as post-commit review for 254305 by Michael Kruse.

llvm-svn: 254327
This commit is contained in:
Tobias Grosser 2015-11-30 21:13:43 +00:00
parent 28a661ec80
commit 3a6ac9f9b5

View File

@ -1468,8 +1468,7 @@ void ScopStmt::removeMemoryAccesses(MemoryAccessList &InvMAs) {
// together with all scalar accesses that were caused by them.
for (MemoryAccess *MA : InvMAs) {
auto Predicate = [&](MemoryAccess *Acc) {
return Acc == MA ||
Acc->getAccessInstruction() == MA->getAccessInstruction();
return Acc->getAccessInstruction() == MA->getAccessInstruction();
};
MemAccs.erase(std::remove_if(MemAccs.begin(), MemAccs.end(), Predicate),
MemAccs.end());