[clang-tidy] Rewrite a for-range loop in the old style.

Haven't thought that I ever needed to do this, but in this case comparing the
index using pointer arithmetic turns out to be really ugly. It also generates
nasty sign-compare warnings on 32 bit targets.

llvm-svn: 214705
This commit is contained in:
Benjamin Kramer 2014-08-04 10:11:47 +00:00
parent 1cd57ebb6b
commit f5847cf84c
1 changed files with 3 additions and 3 deletions

View File

@ -86,10 +86,10 @@ ArgumentCommentCheck::isLikelyTypo(llvm::ArrayRef<ParmVarDecl *> Params,
if (ThisED >= UpperBound)
return false;
for (const auto &Param : Params) {
if (&Param - Params.begin() == ArgIndex)
for (unsigned I = 0, E = Params.size(); I != E; ++I) {
if (I == ArgIndex)
continue;
IdentifierInfo *II = Param->getIdentifier();
IdentifierInfo *II = Params[I]->getIdentifier();
if (!II)
continue;