diff options
author | tsepez <tsepez@chromium.org> | 2016-05-12 10:08:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-12 10:08:06 -0700 |
commit | aadedf904d6e072e885f6ccd142c5f874833d5c5 (patch) | |
tree | 8d44df3c03db12a1745f2c597871aa4b97f4b862 /xfa/fxfa/parser/xfa_utils.h | |
parent | fc1136525693c4aad2c803ca14bd25ff4a658f37 (diff) | |
download | pdfium-aadedf904d6e072e885f6ccd142c5f874833d5c5.tar.xz |
Replace CXFA_PtrSetTemplate with std::unordered_set.
Building a set on top of a map and ignoring the mapped
value seems wasteful.
Review-Url: https://codereview.chromium.org/1942903003
Diffstat (limited to 'xfa/fxfa/parser/xfa_utils.h')
-rw-r--r-- | xfa/fxfa/parser/xfa_utils.h | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h index c2a0fbbb82..821e485e25 100644 --- a/xfa/fxfa/parser/xfa_utils.h +++ b/xfa/fxfa/parser/xfa_utils.h @@ -13,6 +13,8 @@ class CFDE_XMLElement; class CFDE_XMLNode; class CXFA_LocaleValue; +class CXFA_Node; +class CXFA_WidgetData; inline FX_BOOL XFA_IsSpace(FX_WCHAR c) { return (c == 0x20) || (c == 0x0d) || (c == 0x0a) || (c == 0x09); @@ -162,43 +164,6 @@ class CXFA_NodeIteratorTemplate { NodeType* m_pRoot; CFX_StackTemplate<NodeType*> m_NodeStack; }; -template <class KeyType> -class CXFA_PtrSetTemplate : private CFX_MapPtrToPtr { - public: - CXFA_PtrSetTemplate() : CFX_MapPtrToPtr(10) {} - - int GetCount() const { return CFX_MapPtrToPtr::GetCount(); } - - FX_BOOL IsEmpty() const { return CFX_MapPtrToPtr::IsEmpty(); } - - FX_BOOL Lookup(KeyType key) const { - void* pValue = NULL; - return CFX_MapPtrToPtr::Lookup((void*)key, pValue); - } - - FX_BOOL operator[](KeyType key) { return Lookup(key); } - - void Add(KeyType key) { CFX_MapPtrToPtr::SetAt((void*)key, (void*)key); } - - FX_BOOL RemoveKey(KeyType key) { - return CFX_MapPtrToPtr::RemoveKey((void*)key); - } - - void RemoveAll() { CFX_MapPtrToPtr::RemoveAll(); } - - FX_POSITION GetStartPosition() const { - return CFX_MapPtrToPtr::GetStartPosition(); - } - - void GetNextAssoc(FX_POSITION& rNextPosition, KeyType& rKey) const { - void* pKey = NULL; - void* pValue = NULL; - CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); - rKey = (KeyType)(uintptr_t)pKey; - } -}; -class CXFA_Node; -class CXFA_WidgetData; CXFA_Node* XFA_CreateUIChild(CXFA_Node* pNode, XFA_ELEMENT& eWidgetType); CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData); |