[llvm-branch-commits] [llvm-branch] r83946 - /llvm/branches/release_26/include/llvm/ADT/SmallString.h

Tanya Lattner tonic at nondot.org
Mon Oct 12 23:01:01 PDT 2009


Author: tbrethou
Date: Tue Oct 13 01:01:01 2009
New Revision: 83946

URL: http://llvm.org/viewvc/llvm-project?rev=83946&view=rev
Log:
Merge 79729 from mainline.
Change SmallString::operator{=,+=} to take a StringRef.


Modified:
    llvm/branches/release_26/include/llvm/ADT/SmallString.h

Modified: llvm/branches/release_26/include/llvm/ADT/SmallString.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/include/llvm/ADT/SmallString.h?rev=83946&r1=83945&r2=83946&view=diff

==============================================================================
--- llvm/branches/release_26/include/llvm/ADT/SmallString.h (original)
+++ llvm/branches/release_26/include/llvm/ADT/SmallString.h Tue Oct 13 01:01:01 2009
@@ -41,13 +41,13 @@
   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) {





More information about the llvm-branch-commits mailing list