From aadedf904d6e072e885f6ccd142c5f874833d5c5 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 12 May 2016 10:08:06 -0700 Subject: 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 --- xfa/fxfa/parser/xfa_utils.h | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) (limited to 'xfa/fxfa/parser/xfa_utils.h') 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 m_NodeStack; }; -template -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); -- cgit v1.2.3