From 076160d318051f0610075158559c94cd83255516 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 8 Jun 2024 07:05:45 -0700 Subject: [PATCH] [ProfileData] Use a range-based for loop (NFC) While I am at it, this patch adds const to a couple of places. --- llvm/lib/ProfileData/InstrProfReader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp index 7758363d9c952..27855bf92b871 100644 --- a/llvm/lib/ProfileData/InstrProfReader.cpp +++ b/llvm/lib/ProfileData/InstrProfReader.cpp @@ -145,11 +145,11 @@ readBinaryIdsInternal(const MemoryBuffer &DataBuffer, static void printBinaryIdsInternal(raw_ostream &OS, - std::vector &BinaryIds) { + const std::vector &BinaryIds) { OS << "Binary IDs: \n"; - for (auto BI : BinaryIds) { - for (uint64_t I = 0; I < BI.size(); I++) - OS << format("%02x", BI[I]); + for (const auto &BI : BinaryIds) { + for (auto I : BI) + OS << format("%02x", I); OS << "\n"; } }