Chromium Code Reviews| Index: core/fxcrt/fx_basic_wstring.cpp |
| diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp |
| index 88fc5889470129c012cee53fcd38b18d8d8c3005..03c71bf9f82b61abb411e0fe87782e857b219b47 100644 |
| --- a/core/fxcrt/fx_basic_wstring.cpp |
| +++ b/core/fxcrt/fx_basic_wstring.cpp |
| @@ -194,6 +194,15 @@ bool CFX_WideString::operator==(const CFX_WideString& other) const { |
| m_pData->m_nDataLength) == 0; |
| } |
| +bool CFX_WideString::operator<(const CFX_WideString& str) const { |
| + if (m_pData == str.m_pData) |
| + return true; |
|
dsinclair
2016/09/15 17:21:34
false?
Should we create a couple simple unit test
Tom Sepez
2016/09/15 17:25:29
I am a moron. Fixed.
|
| + |
| + int result = |
| + wmemcmp(c_str(), str.c_str(), std::min(GetLength(), str.GetLength())); |
| + return result < 0 || (result == 0 && GetLength() < str.GetLength()); |
| +} |
| + |
| void CFX_WideString::AssignCopy(const FX_WCHAR* pSrcData, FX_STRSIZE nSrcLen) { |
| AllocBeforeWrite(nSrcLen); |
| m_pData->CopyContents(pSrcData, nSrcLen); |