summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-06-30 14:57:12 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-30 19:56:30 +0000
commit573b10a8869b7fe1e17c2d27ddbfc3d6ef93ba43 (patch)
tree07397be6ef483d5f388e126c726f068fbe5fda61 /core/fxcrt
parentf3024c3b1fbbfe442f93da3459ea79e817d5b8fe (diff)
downloadpdfium-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.h7
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;