From dbecba642f97ac629f9490597cf0a92a9996fec6 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 27 Jul 2017 11:25:05 -0400 Subject: Removed unused helper function XFA_FM_KeywordToString is no longer used, and there are no plans to use it in the future, so should be removed. Bug: Change-Id: I44652a40f6396b25262f840c42036fb00a14aca1 Reviewed-on: https://pdfium-review.googlesource.com/9210 Commit-Queue: Ryan Harrison Reviewed-by: dsinclair --- xfa/fxfa/fm2js/cxfa_fmlexer.cpp | 14 ++++---------- xfa/fxfa/fm2js/cxfa_fmlexer.h | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp index c8a064fad0..dc86c23b06 100644 --- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp @@ -98,25 +98,19 @@ const XFA_FM_TOKEN KEYWORD_END = TOKendif; XFA_FM_TOKEN TokenizeIdentifier(const CFX_WideStringC& str) { uint32_t key = FX_HashCode_GetW(str, true); + const XFA_FMKeyword* end = std::begin(keyWords) + KEYWORD_END + 1; const XFA_FMKeyword* result = - std::lower_bound(std::begin(keyWords) + KEYWORD_START, std::end(keyWords), - key, [](const XFA_FMKeyword& iter, const uint32_t& val) { + std::lower_bound(std::begin(keyWords) + KEYWORD_START, end, key, + [](const XFA_FMKeyword& iter, const uint32_t& val) { return iter.m_hash < val; }); - if (result != std::end(keyWords) && result->m_hash == key) { + if (result != end && result->m_hash == key) return result->m_type; - } return TOKidentifier; } } // namespace -const wchar_t* XFA_FM_KeywordToString(XFA_FM_TOKEN op) { - if (op < KEYWORD_START || op > KEYWORD_END) - return L""; - return keyWords[op].m_keyword; -} - CXFA_FMToken::CXFA_FMToken() : m_type(TOKreserver), m_line_num(1) {} CXFA_FMToken::CXFA_FMToken(uint32_t line_num) diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.h b/xfa/fxfa/fm2js/cxfa_fmlexer.h index c944266d37..b3f13dae7a 100644 --- a/xfa/fxfa/fm2js/cxfa_fmlexer.h +++ b/xfa/fxfa/fm2js/cxfa_fmlexer.h @@ -89,8 +89,6 @@ struct XFA_FMKeyword { const wchar_t* m_keyword; }; -const wchar_t* XFA_FM_KeywordToString(XFA_FM_TOKEN op); - class CXFA_FMToken { public: CXFA_FMToken(); -- cgit v1.2.3