Skip to content

Commit bfab159

Browse files
kazutakahiratagithub-actions[bot]
authored andcommitted
Automerge: [TargetParser] Use StringRef::contains (NFC) (#166009)
Identified with readability-container-contains.
2 parents cdaa97d + 8331c73 commit bfab159

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/unittests/TargetParser/TargetParserTest.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,7 @@ TEST(TargetParserTest, ARMFPUNeonSupportLevel) {
737737
for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
738738
FK <= ARM::FPUKind::FK_LAST;
739739
FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1))
740-
if (FK == ARM::FK_LAST ||
741-
ARM::getFPUName(FK).find("neon") == std::string::npos)
740+
if (FK == ARM::FK_LAST || !ARM::getFPUName(FK).contains("neon"))
742741
EXPECT_EQ(ARM::NeonSupportLevel::None, ARM::getFPUNeonSupportLevel(FK));
743742
else
744743
EXPECT_NE(ARM::NeonSupportLevel::None, ARM::getFPUNeonSupportLevel(FK));
@@ -748,9 +747,8 @@ TEST(TargetParserTest, ARMFPURestriction) {
748747
for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
749748
FK <= ARM::FPUKind::FK_LAST;
750749
FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1)) {
751-
if (FK == ARM::FK_LAST ||
752-
(ARM::getFPUName(FK).find("d16") == std::string::npos &&
753-
ARM::getFPUName(FK).find("vfpv3xd") == std::string::npos))
750+
if (FK == ARM::FK_LAST || (!ARM::getFPUName(FK).contains("d16") &&
751+
!ARM::getFPUName(FK).contains("vfpv3xd")))
754752
EXPECT_EQ(ARM::FPURestriction::None, ARM::getFPURestriction(FK));
755753
else
756754
EXPECT_NE(ARM::FPURestriction::None, ARM::getFPURestriction(FK));

0 commit comments

Comments
 (0)