diff options
author | Kazu Hirata <kazu@google.com> | 2024-04-25 15:39:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-25 15:39:42 -0700 |
commit | 1f38b8a281b1b4ed0d018f09c1a080bb7fdcc6ad (patch) | |
tree | edbb19f7ffe1bcf53b300cdb4528dca3194687e3 /llvm/unittests/ProfileData/MemProfTest.cpp | |
parent | eb4a510283bdbf1e6f0b47a9e20ea88b775c5a85 (diff) | |
download | llvm-1f38b8a281b1b4ed0d018f09c1a080bb7fdcc6ad.zip llvm-1f38b8a281b1b4ed0d018f09c1a080bb7fdcc6ad.tar.gz llvm-1f38b8a281b1b4ed0d018f09c1a080bb7fdcc6ad.tar.bz2 |
[memprof] Use DenseMap::contains (NFC) (#90124)
This patch replaces count with contains, following the spirit of
clang-tidy's readability-container-contains.
Diffstat (limited to 'llvm/unittests/ProfileData/MemProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/MemProfTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index 5039010..98dacd3 100644 --- a/llvm/unittests/ProfileData/MemProfTest.cpp +++ b/llvm/unittests/ProfileData/MemProfTest.cpp @@ -179,7 +179,7 @@ TEST(MemProf, FillsValue) { // Check the memprof record for foo. const llvm::GlobalValue::GUID FooId = IndexedMemProfRecord::getGUID("foo"); - ASSERT_EQ(Records.count(FooId), 1U); + ASSERT_TRUE(Records.contains(FooId)); const MemProfRecord &Foo = Records[FooId]; ASSERT_THAT(Foo.AllocSites, SizeIs(1)); EXPECT_EQ(Foo.AllocSites[0].Info.getAllocCount(), 1U); @@ -195,7 +195,7 @@ TEST(MemProf, FillsValue) { // Check the memprof record for bar. const llvm::GlobalValue::GUID BarId = IndexedMemProfRecord::getGUID("bar"); - ASSERT_EQ(Records.count(BarId), 1U); + ASSERT_TRUE(Records.contains(BarId)); const MemProfRecord &Bar = Records[BarId]; ASSERT_THAT(Bar.AllocSites, SizeIs(1)); EXPECT_EQ(Bar.AllocSites[0].Info.getAllocCount(), 1U); @@ -215,7 +215,7 @@ TEST(MemProf, FillsValue) { // Check the memprof record for xyz. const llvm::GlobalValue::GUID XyzId = IndexedMemProfRecord::getGUID("xyz"); - ASSERT_EQ(Records.count(XyzId), 1U); + ASSERT_TRUE(Records.contains(XyzId)); const MemProfRecord &Xyz = Records[XyzId]; ASSERT_THAT(Xyz.CallSites, SizeIs(1)); ASSERT_THAT(Xyz.CallSites[0], SizeIs(2)); @@ -226,7 +226,7 @@ TEST(MemProf, FillsValue) { // Check the memprof record for abc. const llvm::GlobalValue::GUID AbcId = IndexedMemProfRecord::getGUID("abc"); - ASSERT_EQ(Records.count(AbcId), 1U); + ASSERT_TRUE(Records.contains(AbcId)); const MemProfRecord &Abc = Records[AbcId]; EXPECT_TRUE(Abc.AllocSites.empty()); ASSERT_THAT(Abc.CallSites, SizeIs(1)); |