diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-04-26 10:55:54 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-26 20:07:23 +0000 |
commit | e47e0c96009b8633294eebbb9eb0e84caf525c57 (patch) | |
tree | 093c0edb121e54c22e40a704ce473eb48491ccfc /xfa/fxfa/parser/cxfa_node.cpp | |
parent | 2e2a4fcd43677c5882dcf00cb4b99635cb2cfcd3 (diff) | |
download | pdfium-e47e0c96009b8633294eebbb9eb0e84caf525c57.tar.xz |
Avoid unordered_set and maps for the time being.chromium/3082
See discussion at
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/rdxOHKzQmRY
Change-Id: I1803ae97c39b592001835814e2f6674b2c7cb3ea
Reviewed-on: https://pdfium-review.googlesource.com/4531
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 73fc88db8f..9fae4a43aa 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -8,7 +8,7 @@ #include <map> #include <memory> -#include <unordered_set> +#include <set> #include <utility> #include <vector> @@ -90,7 +90,7 @@ int32_t GetCount(CXFA_Node* pInstMgrNode) { } std::vector<CXFA_Node*> NodesSortedByDocumentIdx( - const std::unordered_set<CXFA_Node*>& rgNodeSet) { + const std::set<CXFA_Node*>& rgNodeSet) { if (rgNodeSet.empty()) return std::vector<CXFA_Node*>(); @@ -105,8 +105,7 @@ std::vector<CXFA_Node*> NodesSortedByDocumentIdx( return rgNodeArray; } -using CXFA_NodeSetPair = - std::pair<std::unordered_set<CXFA_Node*>, std::unordered_set<CXFA_Node*>>; +using CXFA_NodeSetPair = std::pair<std::set<CXFA_Node*>, std::set<CXFA_Node*>>; using CXFA_NodeSetPairMap = std::map<uint32_t, std::unique_ptr<CXFA_NodeSetPair>>; using CXFA_NodeSetPairMapMap = @@ -129,8 +128,8 @@ CXFA_NodeSetPair* NodeSetPairForNode(CXFA_Node* pNode, return (*pNodeSetPairMap)[dwNameHash].get(); } -void ReorderDataNodes(const std::unordered_set<CXFA_Node*>& sSet1, - const std::unordered_set<CXFA_Node*>& sSet2, +void ReorderDataNodes(const std::set<CXFA_Node*>& sSet1, + const std::set<CXFA_Node*>& sSet2, bool bInsertBefore) { CXFA_NodeSetPairMapMap rgMap; for (CXFA_Node* pNode : sSet1) { @@ -231,8 +230,8 @@ void InsertItem(CXFA_Node* pInstMgrNode, pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent) ->InsertChild(pNewInstance, pNextSibling); if (bMoveDataBindingNodes) { - std::unordered_set<CXFA_Node*> sNew; - std::unordered_set<CXFA_Node*> sAfter; + std::set<CXFA_Node*> sNew; + std::set<CXFA_Node*> sAfter; CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode> sIteratorNew(pNewInstance); @@ -262,8 +261,8 @@ void InsertItem(CXFA_Node* pInstMgrNode, pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent) ->InsertChild(pNewInstance, pBeforeInstance); if (bMoveDataBindingNodes) { - std::unordered_set<CXFA_Node*> sNew; - std::unordered_set<CXFA_Node*> sBefore; + std::set<CXFA_Node*> sNew; + std::set<CXFA_Node*> sBefore; CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode> sIteratorNew(pNewInstance); |