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

Unified Diff: core/fxcrt/fx_basic_bstring.cpp

Issue 2338623005: Add check for trivial string equality (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | 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 d0ba1af5ba7bb7614f5ad0d2f034aa04e67c211f..0b9d9873d8dc02f647d615916a6f35beab136fcf 100644
--- a/core/fxcrt/fx_basic_bstring.cpp
+++ b/core/fxcrt/fx_basic_bstring.cpp
@@ -202,6 +202,9 @@ bool CFX_ByteString::operator==(const CFX_ByteStringC& str) const {
}
bool CFX_ByteString::operator==(const CFX_ByteString& other) const {
+ if (m_pData == other.m_pData)
+ return true;
+
if (IsEmpty())
return other.IsEmpty();
« no previous file with comments | « no previous file | core/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698