From: Daniel Dunbar Date: Sat, 22 Aug 2009 06:06:46 +0000 (+0000) Subject: Change SmallString::operator{=,+=} to take a StringRef. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=39db3439bfcdca4073dd513879f8ce12ee8c593b;p=oota-llvm.git Change SmallString::operator{=,+=} to take a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79729 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/SmallString.h b/include/llvm/ADT/SmallString.h index 852c32cec95..d5856ac9f1f 100644 --- a/include/llvm/ADT/SmallString.h +++ b/include/llvm/ADT/SmallString.h @@ -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) {