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

Unified Diff: core/fxcrt/include/fx_string.h

Issue 2347433004: Add short-cut in CFX_{Byte,Wide}String::Operator<() (Closed)
Patch Set: Logic goof 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 | « core/fxcrt/fx_basic_wstring.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/include/fx_string.h
diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h
index c1bd82dd7470367cd812cae61215cdedfe7f503a..48378586d3f270a34e83e203eccb576446896d7f 100644
--- a/core/fxcrt/include/fx_string.h
+++ b/core/fxcrt/include/fx_string.h
@@ -88,11 +88,7 @@ class CFX_ByteString {
return !(*this == other);
}
- bool operator<(const CFX_ByteString& str) const {
- int result = FXSYS_memcmp(c_str(), str.c_str(),
- std::min(GetLength(), str.GetLength()));
- return result < 0 || (result == 0 && GetLength() < str.GetLength());
- }
+ bool operator<(const CFX_ByteString& str) const;
const CFX_ByteString& operator=(const FX_CHAR* str);
const CFX_ByteString& operator=(const CFX_ByteStringC& bstrc);
@@ -295,11 +291,7 @@ class CFX_WideString {
return !(*this == other);
}
- bool operator<(const CFX_WideString& str) const {
- int result =
- wmemcmp(c_str(), str.c_str(), std::min(GetLength(), str.GetLength()));
- return result < 0 || (result == 0 && GetLength() < str.GetLength());
- }
+ bool operator<(const CFX_WideString& str) const;
FX_WCHAR GetAt(FX_STRSIZE nIndex) const {
return m_pData ? m_pData->m_String[nIndex] : 0;
« no previous file with comments | « core/fxcrt/fx_basic_wstring.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698