From 818490ab2abe36dfc6c13d01fea5220bd64cca8c Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Thu, 5 Aug 2010 16:21:23 -0700 Subject: Fix String8::operator+ The LHS was ignored when using: String8 + String8 String8 + (const char*) Add unit tests for above. Bug: 2898473 Change-Id: Ic8fe7be668b665c36aaaa3fc3c3ffdfff0fbba25 --- include/utils/String8.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/utils/String8.h') diff --git a/include/utils/String8.h b/include/utils/String8.h index 0b18fe3d22a8..4e41410f4388 100644 --- a/include/utils/String8.h +++ b/include/utils/String8.h @@ -374,7 +374,7 @@ inline String8& String8::operator+=(const String8& other) inline String8 String8::operator+(const String8& other) const { - String8 tmp; + String8 tmp(*this); tmp += other; return tmp; } @@ -387,7 +387,7 @@ inline String8& String8::operator+=(const char* other) inline String8 String8::operator+(const char* other) const { - String8 tmp; + String8 tmp(*this); tmp += other; return tmp; } -- cgit v1.2.3-59-g8ed1b