[cfe-commits] r82308 - /cfe/trunk/include/clang/Basic/IdentifierTable.h
Benjamin Kramer
benny.kra at googlemail.com
Sat Sep 19 01:02:47 PDT 2009
Author: d0k
Date: Sat Sep 19 03:02:46 2009
New Revision: 82308
URL: http://llvm.org/viewvc/llvm-project?rev=82308&view=rev
Log:
Simplify code with a StringRef.
Modified:
cfe/trunk/include/clang/Basic/IdentifierTable.h
Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=82308&r1=82307&r2=82308&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Sat Sep 19 03:02:46 2009
@@ -334,13 +334,8 @@
return *II;
}
- IdentifierInfo &get(const char *Name) {
- return get(Name, Name+strlen(Name));
- }
- IdentifierInfo &get(const std::string &Name) {
- // Don't use c_str() here: no need to be null terminated.
- const char *NameBytes = Name.data();
- return get(NameBytes, NameBytes+Name.size());
+ IdentifierInfo &get(const llvm::StringRef& Name) {
+ return get(Name.begin(), Name.end());
}
typedef HashTableTy::const_iterator iterator;
More information about the cfe-commits
mailing list