From 24f8e29b4efe70496474c6d43aa6abfa27c21511 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 13 Nov 2009 21:55:31 +0000 Subject: 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 --- include/llvm/ADT/StringRef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/llvm/ADT/StringRef.h') 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 -- cgit v1.2.3-18-g5258