[llvm] 9b94869 - [memprof] Use front instead of begin in a unit test (NFC) (#119501)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 11 09:16:48 PST 2024
Author: Kazu Hirata
Date: 2024-12-11T09:16:44-08:00
New Revision: 9b94869942bb71daeb119e7701d806ae0003cc0d
URL: https://github.com/llvm/llvm-project/commit/9b94869942bb71daeb119e7701d806ae0003cc0d
DIFF: https://github.com/llvm/llvm-project/commit/9b94869942bb71daeb119e7701d806ae0003cc0d.diff
LOG: [memprof] Use front instead of begin in a unit test (NFC) (#119501)
"front" allows us to drop a dereference.
Added:
Modified:
llvm/unittests/ProfileData/MemProfTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp
index 5886d3e2bcf842..c1b8f2432bde46 100644
--- a/llvm/unittests/ProfileData/MemProfTest.cpp
+++ b/llvm/unittests/ProfileData/MemProfTest.cpp
@@ -748,7 +748,7 @@ TEST(MemProf, YAMLParser) {
// Verify the entire contents of MemProfData.Records.
ASSERT_THAT(MemProfData.Records, SizeIs(1));
- const auto &[GUID, Record] = *MemProfData.Records.begin();
+ const auto &[GUID, Record] = MemProfData.Records.front();
EXPECT_EQ(GUID, 0xdeadbeef12345678ULL);
ASSERT_THAT(Record.AllocSites, SizeIs(2));
EXPECT_EQ(Record.AllocSites[0].CSId, hashCallStack(CS1));
More information about the llvm-commits
mailing list