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:
parent
73825c1f37
commit
09f40a7871
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user