[llvm] [memprof] Use front instead of begin in a unit test (NFC) (PR #119501)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 10 21:02:39 PST 2024
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/119501
"front" allows us to drop a dereference.
>From 141b959bc5af3fdfb2b4c1f08a482217a9f8469e Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 10 Dec 2024 20:40:22 -0800
Subject: [PATCH] [memprof] Use front instead of begin in a unit test (NFC)
"front" allows us to drop a dereference.
---
llvm/unittests/ProfileData/MemProfTest.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp
index 093b3a26b5f872..e121bae8b4481b 100644
--- a/llvm/unittests/ProfileData/MemProfTest.cpp
+++ b/llvm/unittests/ProfileData/MemProfTest.cpp
@@ -747,7 +747,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