Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp

Issue 1919563002: Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix issue from c4 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_textlayout.cpp ('k') | xfa/fxfa/fm2js/xfa_lexer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 351aedd669a1ee7dcc0527147786627a6840621e..9ab426d54101a621d7bf352873214dd12a044c84 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -4238,19 +4238,17 @@ void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString,
}
FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData,
uint32_t& iCode) {
- int32_t iLength = pData.GetLength();
- uint32_t uHash = FX_HashCode_String_GetW(pData.c_str(), iLength);
- XFA_FMHtmlHashedReserveCode htmlhashedreservecode;
- int32_t iStart = 0,
- iEnd = (sizeof(reservesForDecode) / sizeof(reservesForDecode[0])) - 1;
- int32_t iMid = (iStart + iEnd) / 2;
+ uint32_t uHash = FX_HashCode_GetW(pData, false);
+ int32_t iStart = 0;
+ int32_t iEnd = FX_ArraySize(reservesForDecode) - 1;
do {
- iMid = (iStart + iEnd) / 2;
- htmlhashedreservecode = reservesForDecode[iMid];
+ int32_t iMid = (iStart + iEnd) / 2;
+ XFA_FMHtmlHashedReserveCode htmlhashedreservecode = reservesForDecode[iMid];
if (uHash == htmlhashedreservecode.m_uHash) {
iCode = htmlhashedreservecode.m_uCode;
return TRUE;
- } else if (uHash < htmlhashedreservecode.m_uHash) {
+ }
+ if (uHash < htmlhashedreservecode.m_uHash) {
iEnd = iMid - 1;
} else {
iStart = iMid + 1;
« no previous file with comments | « xfa/fxfa/app/xfa_textlayout.cpp ('k') | xfa/fxfa/fm2js/xfa_lexer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698