bool applyAllReplacements(const Replacements &Replaces, Rewriter &Rewrite) { bool Result = true; for (Replacements::const_iterator I = Replaces.begin(), E = Replaces.end(); I != E; ++I) { if (I->isApplicable()) { Result = I->apply(Rewrite) && Result; } else { Result = false; } } return Result; }
bool applyAllReplacements(Replacements &Replaces, Rewriter &Rewrite) { bool Result = true; for(Replacements::iterator B = Replaces.begin(), I = B, E = Replaces.end(); I != E; ++I) { Replacements::iterator S = std::search(I+1,E,I,I+1,Replacement::Equal()); if (S != E) { I = Replaces.erase(I)-1; E = Replaces.end(); } } for (Replacements::const_iterator I = Replaces.begin(), E = Replaces.end(); I != E; ++I) { if (I->isApplicable()) { Result = I->apply(Rewrite) && Result; } else { Result = false; } } return Result; }