diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-06-30 14:57:12 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-06-30 19:56:30 +0000 |
commit | 573b10a8869b7fe1e17c2d27ddbfc3d6ef93ba43 (patch) | |
tree | 07397be6ef483d5f388e126c726f068fbe5fda61 /core/fxcrt | |
parent | f3024c3b1fbbfe442f93da3459ea79e817d5b8fe (diff) | |
download | pdfium-573b10a8869b7fe1e17c2d27ddbfc3d6ef93ba43.tar.xz |
Remove hand rolled bsearch from HTMLSTR2Code
BUG=pdfium:786
Change-Id: I0779dccb6db0e6ea3933279914153ef7961d9a5b
Reviewed-on: https://pdfium-review.googlesource.com/7152
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/cfx_string_c_template.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_string_c_template.h b/core/fxcrt/cfx_string_c_template.h index 89d0727b0f..5dfff69a95 100644 --- a/core/fxcrt/cfx_string_c_template.h +++ b/core/fxcrt/cfx_string_c_template.h @@ -167,6 +167,13 @@ class CFX_StringCTemplate { return result < 0 || (result == 0 && m_Length < that.m_Length); } + bool operator>(const CFX_StringCTemplate& that) const { + int result = FXSYS_cmp(reinterpret_cast<const CharType*>(m_Ptr.Get()), + reinterpret_cast<const CharType*>(that.m_Ptr.Get()), + std::min(m_Length, that.m_Length)); + return result > 0 || (result == 0 && m_Length > that.m_Length); + } + protected: CFX_UnownedPtr<const UnsignedType> m_Ptr; FX_STRSIZE m_Length; |