diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-10 09:51:00 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-10 09:51:00 +0000 |
commit | dbdaf83779e2ea1330686c5210b340c35d306bba (patch) | |
tree | 5f4eb7817b278bb88ec22e3d57519a6653af0cc5 /lib/Lex/HeaderMap.cpp | |
parent | 3cd8bd4226dc39dbeb729edab42afaf440a02ef2 (diff) |
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93114 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderMap.cpp')
-rw-r--r-- | lib/Lex/HeaderMap.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/Lex/HeaderMap.cpp b/lib/Lex/HeaderMap.cpp index 20de65f91f..4010d613ac 100644 --- a/lib/Lex/HeaderMap.cpp +++ b/lib/Lex/HeaderMap.cpp @@ -173,17 +173,6 @@ const char *HeaderMap::getString(unsigned StrTabIdx) const { return FileBuffer->getBufferStart()+StrTabIdx; } -/// StringsEqualWithoutCase - Compare the specified two strings for case- -/// insensitive equality, returning true if they are equal. Both strings are -/// known to have the same length. -static bool StringsEqualWithoutCase(const char *S1, const char *S2, - unsigned Len) { - for (; Len; ++S1, ++S2, --Len) - if (tolower(*S1) != tolower(*S2)) - return false; - return true; -} - //===----------------------------------------------------------------------===// // The Main Drivers //===----------------------------------------------------------------------===// @@ -226,13 +215,7 @@ const FileEntry *HeaderMap::LookupFile(llvm::StringRef Filename, if (B.Key == HMAP_EmptyBucketKey) return 0; // Hash miss. // See if the key matches. If not, probe on. - const char *Key = getString(B.Key); - unsigned BucketKeyLen = strlen(Key); - if (BucketKeyLen != unsigned(Filename.size())) - continue; - - // See if the actual strings equal. - if (!StringsEqualWithoutCase(Filename.begin(), Key, BucketKeyLen)) + if (!Filename.equals_lower(getString(B.Key))) continue; // If so, we have a match in the hash table. Construct the destination |