diff options
| author | 2010-10-20 15:47:04 -0700 | |
|---|---|---|
| committer | 2010-10-20 15:47:04 -0700 | |
| commit | fb3132e86631277b73abeceea92d1e2e40b83503 (patch) | |
| tree | 94df1a954f15864c942ee467fabf24dc92d2b504 /include/utils/String8.h | |
| parent | fb26350c00069edcabbfce6bc1805ebfd4f9efb7 (diff) | |
| parent | e28210d401ae4ed1258b84c9b17a172a757190e8 (diff) | |
Merge "Add length-equality test in String operator== checks."
Diffstat (limited to 'include/utils/String8.h')
| -rw-r--r-- | include/utils/String8.h | 4 |
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 |