1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Fix pasto in StringRef::count(char)

llvm-svn: 79356
This commit is contained in:
Daniel Dunbar 2009-08-18 18:34:22 +00:00
parent 73825c1f37
commit 09f40a7871
2 changed files with 2 additions and 1 deletions

View File

@ -177,7 +177,7 @@ namespace llvm {
size_t Count = 0;
for (size_t i = 0, e = Length; i != e; ++i)
if (Data[i] == C)
return i;
++Count;
return Count;
}

View File

@ -96,6 +96,7 @@ TEST(StringRefTest, Utilities) {
EXPECT_TRUE(Str.find("zz") == StringRef::npos);
EXPECT_TRUE(Str.count('l') == 2);
EXPECT_TRUE(Str.count('o') == 1);
EXPECT_TRUE(Str.count('z') == 0);
EXPECT_TRUE(Str.count("helloworld") == 0);
EXPECT_TRUE(Str.count("hello") == 1);