Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: core/fxcrt/fx_basic_bstring.cpp

Issue 1846083002: Remove CFX_{Byte,Wide}String::Equal in favor of "==". (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/doc_formcontrol.cpp ('k') | core/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_bstring.cpp
diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp
index 10bc05bcc5b8024153723aa2104b7c5ee6c33a28..08f5dca664637ebaee75b62309bfa3d8934173c1 100644
--- a/core/fxcrt/fx_basic_bstring.cpp
+++ b/core/fxcrt/fx_basic_bstring.cpp
@@ -217,30 +217,30 @@ const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteStringC& str) {
ConcatInPlace(str.GetLength(), str.GetCStr());
return *this;
}
-bool CFX_ByteString::Equal(const char* ptr) const {
- if (!m_pData) {
- return !ptr || ptr[0] == '\0';
- }
- if (!ptr) {
+bool CFX_ByteString::operator==(const char* ptr) const {
+ if (!m_pData)
+ return !ptr || !ptr[0];
+
+ if (!ptr)
return m_pData->m_nDataLength == 0;
- }
+
return FXSYS_strlen(ptr) == m_pData->m_nDataLength &&
FXSYS_memcmp(ptr, m_pData->m_String, m_pData->m_nDataLength) == 0;
}
-bool CFX_ByteString::Equal(const CFX_ByteStringC& str) const {
- if (!m_pData) {
+bool CFX_ByteString::operator==(const CFX_ByteStringC& str) const {
+ if (!m_pData)
return str.IsEmpty();
- }
+
return m_pData->m_nDataLength == str.GetLength() &&
FXSYS_memcmp(m_pData->m_String, str.GetCStr(), str.GetLength()) == 0;
}
-bool CFX_ByteString::Equal(const CFX_ByteString& other) const {
- if (IsEmpty()) {
+bool CFX_ByteString::operator==(const CFX_ByteString& other) const {
+ if (IsEmpty())
return other.IsEmpty();
- }
- if (other.IsEmpty()) {
+
+ if (other.IsEmpty())
return false;
- }
+
return other.m_pData->m_nDataLength == m_pData->m_nDataLength &&
FXSYS_memcmp(other.m_pData->m_String, m_pData->m_String,
m_pData->m_nDataLength) == 0;
« no previous file with comments | « core/fpdfdoc/doc_formcontrol.cpp ('k') | core/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698