From 573b10a8869b7fe1e17c2d27ddbfc3d6ef93ba43 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 30 Jun 2017 14:57:12 -0400 Subject: Remove hand rolled bsearch from HTMLSTR2Code BUG=pdfium:786 Change-Id: I0779dccb6db0e6ea3933279914153ef7961d9a5b Reviewed-on: https://pdfium-review.googlesource.com/7152 Commit-Queue: Ryan Harrison Reviewed-by: Tom Sepez --- core/fxcrt/cfx_string_c_template.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core') 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(m_Ptr.Get()), + reinterpret_cast(that.m_Ptr.Get()), + std::min(m_Length, that.m_Length)); + return result > 0 || (result == 0 && m_Length > that.m_Length); + } + protected: CFX_UnownedPtr m_Ptr; FX_STRSIZE m_Length; -- cgit v1.2.3