diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-23 03:21:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-23 03:21:53 +0000 |
commit | d69121b3c5c9c89ab9ad7c9c71b13b3a1fcde40d (patch) | |
tree | ab54c7fa55db62212be663b534bf9ef0af001e52 /include/llvm/ADT | |
parent | 26a9142bd6e8ae74be42c5ad2ebaa32f1764c693 (diff) | |
download | external_llvm-d69121b3c5c9c89ab9ad7c9c71b13b3a1fcde40d.zip external_llvm-d69121b3c5c9c89ab9ad7c9c71b13b3a1fcde40d.tar.gz external_llvm-d69121b3c5c9c89ab9ad7c9c71b13b3a1fcde40d.tar.bz2 |
modernize stringset interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r-- | include/llvm/ADT/StringSet.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/llvm/ADT/StringSet.h b/include/llvm/ADT/StringSet.h index 0004836..9c55f6b 100644 --- a/include/llvm/ADT/StringSet.h +++ b/include/llvm/ADT/StringSet.h @@ -15,7 +15,6 @@ #define LLVM_ADT_STRINGSET_H #include "llvm/ADT/StringMap.h" -#include <cassert> namespace llvm { @@ -26,10 +25,10 @@ namespace llvm { class StringSet : public llvm::StringMap<char, AllocatorTy> { typedef llvm::StringMap<char, AllocatorTy> base; public: - bool insert(const std::string& InLang) { + bool insert(StringRef InLang) { assert(!InLang.empty()); - const char* KeyStart = &InLang[0]; - const char* KeyEnd = KeyStart + InLang.size(); + const char *KeyStart = InLang.data(); + const char *KeyEnd = KeyStart + InLang.size(); return base::insert(llvm::StringMapEntry<char>:: Create(KeyStart, KeyEnd, base::getAllocator(), '+')); } |