aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/ADT/StringRef.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-13 21:55:31 +0000
committerDan Gohman <gohman@apple.com>2009-11-13 21:55:31 +0000
commit24f8e29b4efe70496474c6d43aa6abfa27c21511 (patch)
treeda0eb51f0d939fca43d7d85cbde3b9a0c6728853 /include/llvm/ADT/StringRef.h
parenta2b3cdc21f51d0e24310878b0c759ec48b5e6749 (diff)
Use .data() instead of .c_str() when nul-termination is not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringRef.h')
-rw-r--r--include/llvm/ADT/StringRef.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h
index 6b17eb22de..b6486e7676 100644
--- a/include/llvm/ADT/StringRef.h
+++ b/include/llvm/ADT/StringRef.h
@@ -56,7 +56,7 @@ namespace llvm {
/// Construct a string ref from an std::string.
/*implicit*/ StringRef(const std::string &Str)
- : Data(Str.c_str()), Length(Str.length()) {}
+ : Data(Str.data()), Length(Str.length()) {}
/// @}
/// @name Iterators