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>
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
index c8a064f..dc86c23 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
@@ -98,25 +98,19 @@
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 c944266..b3f13da 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.h
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.h
@@ -89,8 +89,6 @@
const wchar_t* m_keyword;
};
-const wchar_t* XFA_FM_KeywordToString(XFA_FM_TOKEN op);
-
class CXFA_FMToken {
public:
CXFA_FMToken();