summaryrefslogtreecommitdiffstats
path: root/include/utils/String8.h
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2010-10-20 13:24:58 -0700
committerBrad Fitzpatrick <bradfitz@android.com>2010-10-20 15:03:49 -0700
commite28210d401ae4ed1258b84c9b17a172a757190e8 (patch)
tree33fbac2552b71234b6872bd067e256555d4acae7 /include/utils/String8.h
parent4f5f7c968339a83b6af98ac8893a1ac33c7aa7bc (diff)
downloadframeworks_base-e28210d401ae4ed1258b84c9b17a172a757190e8.zip
frameworks_base-e28210d401ae4ed1258b84c9b17a172a757190e8.tar.gz
frameworks_base-e28210d401ae4ed1258b84c9b17a172a757190e8.tar.bz2
Add length-equality test in String operator== checks.
Change-Id: I6ebc6ef85aac4539269f137c1f29f95b9828d4f9
Diffstat (limited to 'include/utils/String8.h')
-rw-r--r--include/utils/String8.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/utils/String8.h b/include/utils/String8.h
index cef8eca..a129222 100644
--- a/include/utils/String8.h
+++ b/include/utils/String8.h
@@ -418,7 +418,9 @@ inline bool String8::operator<=(const String8& other) const
inline bool String8::operator==(const String8& other) const
{
- return strcmp(mString, other.mString) == 0;
+ return (SharedBuffer::sizeFromData(mString) ==
+ SharedBuffer::sizeFromData(other.mString)) &&
+ strcmp(mString, other.mString) == 0;
}
inline bool String8::operator!=(const String8& other) const