diff options
author | Jakub Staszak <kubastaszak@gmail.com> | 2013-11-04 19:22:50 +0000 |
---|---|---|
committer | Jakub Staszak <kubastaszak@gmail.com> | 2013-11-04 19:22:50 +0000 |
commit | cfcfee0be4fef4061834a0eabbf33b63074efec3 (patch) | |
tree | eb704835fd7d241262279115a0ddfe1d9051ed6d /llvm/lib/Option/OptTable.cpp | |
parent | d80f7d34dec2c02c949bd3e4761d7b7a77e2be8b (diff) | |
download | bcm5719-llvm-cfcfee0be4fef4061834a0eabbf33b63074efec3.tar.gz bcm5719-llvm-cfcfee0be4fef4061834a0eabbf33b63074efec3.zip |
Use startswith_lower() where possible.
llvm-svn: 194007
Diffstat (limited to 'llvm/lib/Option/OptTable.cpp')
-rw-r--r-- | llvm/lib/Option/OptTable.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp index 78c5ea2c441..6fa459a0066 100644 --- a/llvm/lib/Option/OptTable.cpp +++ b/llvm/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(); |