diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-07-27 11:25:05 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-27 16:06:59 +0000 |
commit | dbecba642f97ac629f9490597cf0a92a9996fec6 (patch) | |
tree | fc352e770dd7ada878e27a352b011fe8249e2db2 /xfa | |
parent | 0f25f014b3bff4229cb93a1ca850babc5dd382da (diff) | |
download | pdfium-dbecba642f97ac629f9490597cf0a92a9996fec6.tar.xz |
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 <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmlexer.cpp | 14 | ||||
-rw-r--r-- | 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(); |