diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-01 17:19:56 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-01 17:19:56 +0000 |
commit | 48ce3d08faa51bf00edaa3ae0afda9bf86e14a39 (patch) | |
tree | eae58a710e2c8ba883368ecacbeb31b00a4b6db2 /xfa/fxfa/parser/cxfa_node.cpp | |
parent | 842c26506fae8852299b498bdd00365e561ef7e2 (diff) | |
download | pdfium-48ce3d08faa51bf00edaa3ae0afda9bf86e14a39.tar.xz |
Use size_t and FX_ArraySize() for some arrays.
Change-Id: Ib8caef1f46478e9bf1c0e717997accb71000124a
Reviewed-on: https://pdfium-review.googlesource.com/43192
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 7d707d0baa..603473c61c 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -552,11 +552,12 @@ Optional<XFA_AttributeEnum> CXFA_Node::NameToAttributeEnum( if (name.IsEmpty()) return {}; - auto* it = std::lower_bound(g_XFAEnumData, g_XFAEnumData + g_iXFAEnumCount, + static const auto* kXFAEnumDataEnd = g_XFAEnumData + g_szXFAEnumCount; + auto* it = std::lower_bound(g_XFAEnumData, kXFAEnumDataEnd, FX_HashCode_GetW(name, false), [](const XFA_AttributeEnumInfo& arg, uint32_t hash) { return arg.uHash < hash; }); - if (it != g_XFAEnumData + g_iXFAEnumCount && name == it->pName) + if (it != kXFAEnumDataEnd && name == it->pName) return {it->eName}; return {}; } |