Skip to content

Commit fe21b39

Browse files
[Basic] Use range-based for loops (NFC)
1 parent af8d050 commit fe21b39

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

clang/include/clang/Basic/PlistSupport.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ inline raw_ostream &EmitInteger(raw_ostream &o, int64_t value) {
7777

7878
inline raw_ostream &EmitString(raw_ostream &o, StringRef s) {
7979
o << "<string>";
80-
for (StringRef::const_iterator I = s.begin(), E = s.end(); I != E; ++I) {
81-
char c = *I;
80+
for (char c : s) {
8281
switch (c) {
8382
default:
8483
o << c;

clang/lib/Basic/Warnings.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
198198
}
199199
}
200200

201-
for (unsigned i = 0, e = Opts.Remarks.size(); i != e; ++i) {
202-
StringRef Opt = Opts.Remarks[i];
201+
for (StringRef Opt : Opts.Remarks) {
203202
const auto Flavor = diag::Flavor::Remark;
204203

205204
// Check to see if this warning starts with "no-", if so, this is a

0 commit comments

Comments
 (0)