[llvm-commits] [llvm] r79729 - /llvm/trunk/include/llvm/ADT/SmallString.h
Daniel Dunbar
daniel at zuster.org
Fri Aug 21 23:06:55 PDT 2009
Author: ddunbar
Date: Sat Aug 22 01:06:46 2009
New Revision: 79729
URL: http://llvm.org/viewvc/llvm-project?rev=79729&view=rev
Log:
Change SmallString::operator{=,+=} to take a StringRef.
Modified:
llvm/trunk/include/llvm/ADT/SmallString.h
Modified: llvm/trunk/include/llvm/ADT/SmallString.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallString.h?rev=79729&r1=79728&r2=79729&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallString.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallString.h Sat Aug 22 01:06:46 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-commits
mailing list