Skip to content

Commit 1c88ffb

Browse files
committed
Merge 79729 from mainline.
Change SmallString::operator{=,+=} to take a StringRef. llvm-svn: 83946
1 parent d51a6f1 commit 1c88ffb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/include/llvm/ADT/SmallString.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ class SmallString : public SmallVector<char, InternalLen> {
4141
StringRef str() const { return StringRef(this->begin(), this->size()); }
4242

4343
// Extra operators.
44-
const SmallString &operator=(const char *RHS) {
44+
const SmallString &operator=(StringRef RHS) {
4545
this->clear();
4646
return *this += RHS;
4747
}
4848

49-
SmallString &operator+=(const char *RHS) {
50-
this->append(RHS, RHS+strlen(RHS));
49+
SmallString &operator+=(StringRef RHS) {
50+
this->append(RHS.begin(), RHS.end());
5151
return *this;
5252
}
5353
SmallString &operator+=(char C) {

0 commit comments

Comments
 (0)