summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/HeaderMap.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-01-10 09:51:00 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-01-10 09:51:00 +0000
commit307c2c7ebc32f51d422f38d64cb08fa965f22791 (patch)
tree2f070c1511782f6b44c076a4eeb7259858ed9702 /clang/lib/Lex/HeaderMap.cpp
parent1a05fddcdc1975b16d813177af932eca312e710c (diff)
downloadbcm5719-llvm-307c2c7ebc32f51d422f38d64cb08fa965f22791.tar.gz
bcm5719-llvm-307c2c7ebc32f51d422f38d64cb08fa965f22791.zip
Simplify code. No functionality change.
llvm-svn: 93114
Diffstat (limited to 'clang/lib/Lex/HeaderMap.cpp')
-rw-r--r--clang/lib/Lex/HeaderMap.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp
index 20de65f91f4..4010d613ac2 100644
--- a/clang/lib/Lex/HeaderMap.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud