diff options
author | Kenny Root <kroot@google.com> | 2010-08-05 16:21:23 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2010-08-06 09:00:10 -0700 |
commit | aa966638b9428e78837eff93ef29f10f31193256 (patch) | |
tree | fbb34927bd2793bf953000d03a2a5c46440dafa9 /include/utils/String8.h | |
parent | 9dcf6cf54153c89bfcc35dd6f470a5fc44311a77 (diff) | |
download | frameworks_native-aa966638b9428e78837eff93ef29f10f31193256.zip frameworks_native-aa966638b9428e78837eff93ef29f10f31193256.tar.gz frameworks_native-aa966638b9428e78837eff93ef29f10f31193256.tar.bz2 |
Fix String8::operator+
The LHS was ignored when using:
String8 + String8
String8 + (const char*)
Add unit tests for above.
Bug: 2898473
Change-Id: Ic8fe7be668b665c36aaaa3fc3c3ffdfff0fbba25
Diffstat (limited to 'include/utils/String8.h')
-rw-r--r-- | include/utils/String8.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/utils/String8.h b/include/utils/String8.h index 0b18fe3..4e41410 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; } |