Skip to content

Commit 38124fe

Browse files
[ProfileData] Use a range-based for loop (NFC) (#94856)
While I am at it, this patch adds const to a couple of places.
1 parent c870882 commit 38124fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/ProfileData/InstrProfReader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ readBinaryIdsInternal(const MemoryBuffer &DataBuffer,
145145

146146
static void
147147
printBinaryIdsInternal(raw_ostream &OS,
148-
std::vector<llvm::object::BuildID> &BinaryIds) {
148+
const std::vector<llvm::object::BuildID> &BinaryIds) {
149149
OS << "Binary IDs: \n";
150-
for (auto BI : BinaryIds) {
151-
for (uint64_t I = 0; I < BI.size(); I++)
152-
OS << format("%02x", BI[I]);
150+
for (const auto &BI : BinaryIds) {
151+
for (auto I : BI)
152+
OS << format("%02x", I);
153153
OS << "\n";
154154
}
155155
}

0 commit comments

Comments
 (0)