From: Craig Topper Date: Wed, 21 Oct 2015 04:52:38 +0000 (+0000) Subject: Use std::find instead of a manual loop. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78e23ac299ee8d2c462d092d5edade9893602937;p=clang Use std::find instead of a manual loop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250880 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 048a6d64ba..2ec22cf45f 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -364,10 +364,8 @@ bool TargetInfo::isValidGCCRegisterName(StringRef Name) const { } // Check register names. - for (unsigned i = 0; i < Names.size(); i++) { - if (Name == Names[i]) - return true; - } + if (std::find(Names.begin(), Names.end(), Name) != Names.end()) + return true; // Check any additional names that we have. ArrayRef AddlNames = getGCCAddlRegNames();