diff options
Diffstat (limited to 'idlc')
-rw-r--r-- | idlc/inc/aststruct.hxx | 4 | ||||
-rw-r--r-- | idlc/source/aststruct.cxx | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/idlc/inc/aststruct.hxx b/idlc/inc/aststruct.hxx index 52981cf2b791..bb5ef15152e2 100644 --- a/idlc/inc/aststruct.hxx +++ b/idlc/inc/aststruct.hxx @@ -40,7 +40,7 @@ public: AstScope* pScope); virtual ~AstStruct() override; - DeclList::size_type getTypeParameterCount() const + std::size_t getTypeParameterCount() const { return m_typeParameters.size(); } AstDeclaration const * findTypeParameter(OString const & name) const; @@ -50,7 +50,7 @@ public: virtual bool dump(RegistryKey& rKey) override; private: AstStruct const* m_pBaseType; - DeclList m_typeParameters; + std::vector<std::unique_ptr<AstDeclaration>> m_typeParameters; }; #endif // INCLUDED_IDLC_INC_ASTSTRUCT_HXX diff --git a/idlc/source/aststruct.cxx b/idlc/source/aststruct.cxx index a7db14faaf7f..e06adc2b2bd1 100644 --- a/idlc/source/aststruct.cxx +++ b/idlc/source/aststruct.cxx @@ -32,7 +32,7 @@ AstStruct::AstStruct( { for (auto const& elem : typeParameters) { - m_typeParameters.push_back( + m_typeParameters.emplace_back( new AstType(NT_type_parameter, elem, nullptr)); } } @@ -49,10 +49,6 @@ AstStruct::AstStruct(const NodeType type, AstStruct::~AstStruct() { - for (auto const& elem : m_typeParameters) - { - delete elem; - } } AstDeclaration const * AstStruct::findTypeParameter(OString const & name) @@ -61,7 +57,7 @@ AstDeclaration const * AstStruct::findTypeParameter(OString const & name) for (auto const& elem : m_typeParameters) { if (elem->getLocalName() == name) { - return elem; + return elem.get(); } } return nullptr; |