r250880 - Use std::find instead of a manual loop.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 20 21:52:38 PDT 2015
Author: ctopper
Date: Tue Oct 20 23:52:38 2015
New Revision: 250880
URL: http://llvm.org/viewvc/llvm-project?rev=250880&view=rev
Log:
Use std::find instead of a manual loop.
Modified:
cfe/trunk/lib/Basic/TargetInfo.cpp
Modified: cfe/trunk/lib/Basic/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=250880&r1=250879&r2=250880&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/TargetInfo.cpp (original)
+++ cfe/trunk/lib/Basic/TargetInfo.cpp Tue Oct 20 23:52:38 2015
@@ -364,10 +364,8 @@ bool TargetInfo::isValidGCCRegisterName(
}
// 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<AddlRegName> AddlNames = getGCCAddlRegNames();
More information about the cfe-commits
mailing list