mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-11 13:44:28 +00:00
Fix pasto in StringRef::count(char)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4d91943889
commit
323a3e6533
@ -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