summaryrefslogtreecommitdiffstats
path: root/include/utils
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2010-10-20 17:06:28 -0700
committerBrad Fitzpatrick <bradfitz@android.com>2010-10-20 17:06:28 -0700
commitcf8918874dc446f34bbc2a93a6b20235c30a7645 (patch)
tree6267c828bc01149954e37b827a75ae2c8f0f99e6 /include/utils
parent6913c6176b6d239f833ea21120b93547aa5f93f7 (diff)
downloadframeworks_base-cf8918874dc446f34bbc2a93a6b20235c30a7645.zip
frameworks_base-cf8918874dc446f34bbc2a93a6b20235c30a7645.tar.gz
frameworks_base-cf8918874dc446f34bbc2a93a6b20235c30a7645.tar.bz2
Revert "Add length-equality test in String operator== checks."
This reverts commit e28210d401ae4ed1258b84c9b17a172a757190e8.
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/String16.h4
-rw-r--r--include/utils/String8.h4
2 files changed, 2 insertions, 6 deletions
diff --git a/include/utils/String16.h b/include/utils/String16.h
index d98b2d0..07a0c11 100644
--- a/include/utils/String16.h
+++ b/include/utils/String16.h
@@ -205,9 +205,7 @@ inline bool String16::operator<=(const String16& other) const
inline bool String16::operator==(const String16& other) const
{
- const size_t n1 = size();
- const size_t n2 = other.size();
- return n1 == n2 && strzcmp16(mString, n1, other.mString, n2) == 0;
+ return strzcmp16(mString, size(), other.mString, other.size()) == 0;
}
inline bool String16::operator!=(const String16& other) const
diff --git a/include/utils/String8.h b/include/utils/String8.h
index a129222..cef8eca 100644
--- a/include/utils/String8.h
+++ b/include/utils/String8.h
@@ -418,9 +418,7 @@ inline bool String8::operator<=(const String8& other) const
inline bool String8::operator==(const String8& other) const
{
- return (SharedBuffer::sizeFromData(mString) ==
- SharedBuffer::sizeFromData(other.mString)) &&
- strcmp(mString, other.mString) == 0;
+ return strcmp(mString, other.mString) == 0;
}
inline bool String8::operator!=(const String8& other) const