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
@ -474,9 +474,13 @@ bool Node::containsOccluderNodes() const
|
||||
}
|
||||
|
||||
void Node::setDescriptions(const DescriptionList& descriptions)
|
||||
{
|
||||
// only assign a description list (and associated UseDataContainer) if we need to.
|
||||
if (!descriptions.empty() || getUserDataContainer())
|
||||
{
|
||||
getOrCreateUserDataContainer()->setDescriptions(descriptions);
|
||||
}
|
||||
}
|
||||
|
||||
Node::DescriptionList& Node::getDescriptions()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user