summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-07-27 11:25:05 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-27 16:06:59 +0000
commitdbecba642f97ac629f9490597cf0a92a9996fec6 (patch)
treefc352e770dd7ada878e27a352b011fe8249e2db2 /xfa/fxfa/fm2js/cxfa_fmlexer.cpp
parent0f25f014b3bff4229cb93a1ca850babc5dd382da (diff)
downloadpdfium-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/fxfa/fm2js/cxfa_fmlexer.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmlexer.cpp14
1 files changed, 4 insertions, 10 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)