From 3526b1a4499fa98c46058a1d535f050ea1680bdc Mon Sep 17 00:00:00 2001 From: Jonathan Stone Date: Tue, 15 Oct 2024 13:11:15 -0700 Subject: [PATCH] Use default constructor --- source/MaterialXCore/Element.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/MaterialXCore/Element.cpp b/source/MaterialXCore/Element.cpp index f8d5117de7..16bf75c1c8 100644 --- a/source/MaterialXCore/Element.cpp +++ b/source/MaterialXCore/Element.cpp @@ -286,12 +286,11 @@ ElementPtr Element::changeChildCategory(ElementPtr child, const string& category template shared_ptr Element::getChildOfType(const string& name) const { - ElementPtr child = nullptr; + ElementPtr child; if (isA() && asA()->hasDataLibrary()) { child = asA()->getDataLibrary()->getChild(name); } - if (!child) { child = getChild(name); @@ -306,7 +305,6 @@ template vector> Element::getChildrenOfType(const string { children = asA()->getDataLibrary()->getChildrenOfType(category); } - for (ElementPtr child : _childOrder) { shared_ptr instance = child->asA();