summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJakub Staszak <kubastaszak@gmail.com>2013-11-04 19:22:50 +0000
committerJakub Staszak <kubastaszak@gmail.com>2013-11-04 19:22:50 +0000
commit42f2a6b41ea62d4ccd10a6c469b27549881a7406 (patch)
treecb1e75d9c902adb7313114c0ee9a82ca72b0f330 /lib
parent2e58f1d4cf95e44674cbc4975e713f9293255d5f (diff)
downloadllvm-42f2a6b41ea62d4ccd10a6c469b27549881a7406.tar.gz
llvm-42f2a6b41ea62d4ccd10a6c469b27549881a7406.tar.bz2
llvm-42f2a6b41ea62d4ccd10a6c469b27549881a7406.tar.xz
Use startswith_lower() where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Option/OptTable.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/Option/OptTable.cpp b/lib/Option/OptTable.cpp
index 78c5ea2c44..6fa459a006 100644
--- a/lib/Option/OptTable.cpp
+++ b/lib/Option/OptTable.cpp
@@ -175,13 +175,6 @@ static bool isInput(const llvm::StringSet<> &Prefixes, StringRef Arg) {
return true;
}
-// Returns true if X starts with Y, ignoring case.
-static bool startsWithIgnoreCase(StringRef X, StringRef Y) {
- if (X.size() < Y.size())
- return false;
- return X.substr(0, Y.size()).equals_lower(Y);
-}
-
/// \returns Matched size. 0 means no match.
static unsigned matchOption(const OptTable::Info *I, StringRef Str,
bool IgnoreCase) {
@@ -190,7 +183,7 @@ static unsigned matchOption(const OptTable::Info *I, StringRef Str,
if (Str.startswith(Prefix)) {
StringRef Rest = Str.substr(Prefix.size());
bool Matched = IgnoreCase
- ? startsWithIgnoreCase(Rest, I->Name)
+ ? Rest.startswith_lower(I->Name)
: Rest.startswith(I->Name);
if (Matched)
return Prefix.size() + StringRef(I->Name).size();