summaryrefslogtreecommitdiff
path: root/include/utils/String8.h
diff options
context:
space:
mode:
author Brad Fitzpatrick <bradfitz@android.com> 2010-10-20 15:47:04 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-10-20 15:47:04 -0700
commitfb3132e86631277b73abeceea92d1e2e40b83503 (patch)
tree94df1a954f15864c942ee467fabf24dc92d2b504 /include/utils/String8.h
parentfb26350c00069edcabbfce6bc1805ebfd4f9efb7 (diff)
parente28210d401ae4ed1258b84c9b17a172a757190e8 (diff)
Merge "Add length-equality test in String operator== checks."
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 cef8ecab96b9..a1292227eda7 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