Added lazy setting of the UserDataContainer to avoid unncessarily create a UserDataContain when an empty description list is passed to Node::setDescriptions(..)
This commit is contained in:
parent
51075421d3
commit
c21b60b038
@ -475,7 +475,11 @@ bool Node::containsOccluderNodes() const
|
|||||||
|
|
||||||
void Node::setDescriptions(const DescriptionList& descriptions)
|
void Node::setDescriptions(const DescriptionList& descriptions)
|
||||||
{
|
{
|
||||||
getOrCreateUserDataContainer()->setDescriptions(descriptions);
|
// only assign a description list (and associated UseDataContainer) if we need to.
|
||||||
|
if (!descriptions.empty() || getUserDataContainer())
|
||||||
|
{
|
||||||
|
getOrCreateUserDataContainer()->setDescriptions(descriptions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Node::DescriptionList& Node::getDescriptions()
|
Node::DescriptionList& Node::getDescriptions()
|
||||||
|
Loading…
Reference in New Issue
Block a user