Skip to content

Commit

Permalink
Use default constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Oct 15, 2024
1 parent 60fa822 commit 3526b1a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source/MaterialXCore/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,11 @@ ElementPtr Element::changeChildCategory(ElementPtr child, const string& category

template <class T> shared_ptr<T> Element::getChildOfType(const string& name) const
{
ElementPtr child = nullptr;
ElementPtr child;
if (isA<Document>() && asA<Document>()->hasDataLibrary())
{
child = asA<Document>()->getDataLibrary()->getChild(name);
}

if (!child)
{
child = getChild(name);
Expand All @@ -306,7 +305,6 @@ template <class T> vector<shared_ptr<T>> Element::getChildrenOfType(const string
{
children = asA<Document>()->getDataLibrary()->getChildrenOfType<T>(category);
}

for (ElementPtr child : _childOrder)
{
shared_ptr<T> instance = child->asA<T>();
Expand Down

0 comments on commit 3526b1a

Please sign in to comment.