]> granicus.if.org Git - llvm/commitdiff
Merge 79729 from mainline.
authorTanya Lattner <tonic@nondot.org>
Tue, 13 Oct 2009 06:01:01 +0000 (06:01 +0000)
committerTanya Lattner <tonic@nondot.org>
Tue, 13 Oct 2009 06:01:01 +0000 (06:01 +0000)
Change SmallString::operator{=,+=} to take a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@83946 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallString.h

index 852c32cec955fd77d5710bc3e6a3a4e773d60cb6..d5856ac9f1f17d6ff410ec25f54d6417130d7ed6 100644 (file)
@@ -41,13 +41,13 @@ public:
   StringRef str() const { return StringRef(this->begin(), this->size()); }
 
   // Extra operators.
-  const SmallString &operator=(const char *RHS) {
+  const SmallString &operator=(StringRef RHS) {
     this->clear();
     return *this += RHS;
   }
 
-  SmallString &operator+=(const char *RHS) {
-    this->append(RHS, RHS+strlen(RHS));
+  SmallString &operator+=(StringRef RHS) {
+    this->append(RHS.begin(), RHS.end());
     return *this;
   }
   SmallString &operator+=(char C) {