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

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: win again again again 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
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..c765ff25cdc142ada2a01fb070b2a2ba5658d4e9 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -4238,14 +4238,12 @@ 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);
+ uint32_t uHash = FX_HashCode_GetW(pData, false);
XFA_FMHtmlHashedReserveCode htmlhashedreservecode;
- int32_t iStart = 0,
- iEnd = (sizeof(reservesForDecode) / sizeof(reservesForDecode[0])) - 1;
- int32_t iMid = (iStart + iEnd) / 2;
+ int32_t iStart = 0;
+ int32_t iEnd = (sizeof(reservesForDecode) / sizeof(reservesForDecode[0])) - 1;
Lei Zhang 2016/04/23 01:33:29 FX_ArraySize() ?
Tom Sepez 2016/04/25 16:50:21 yup.
do {
- iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
htmlhashedreservecode = reservesForDecode[iMid];
if (uHash == htmlhashedreservecode.m_uHash) {
iCode = htmlhashedreservecode.m_uCode;

Powered by Google App Engine
This is Rietveld 408576698