summaryrefslogtreecommitdiff
path: root/idlc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-22 12:21:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-23 07:25:01 +0100
commit5053b8cd3f18cb5baa039c343e20b1b87e7b25a5 (patch)
tree22b95a47962745b1bc3a45c3d55f14289cbbf77d /idlc/source
parent2925ded06627fb7e5408f15288490db7c9f0ebb0 (diff)
loplugin:useuniqueptr in AstStruct
Change-Id: Ib7416235e41192323e74061bfce6c162e87612f2 Reviewed-on: https://gerrit.libreoffice.org/51736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idlc/source')
-rw-r--r--idlc/source/aststruct.cxx8
1 files changed, 2 insertions, 6 deletions
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;