this will avoid temporary string allocation.
Change-Id: I21e358150c3ac40496ae62c23562a77551e66acd
}
}
-void Object::AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName ) const
+void Object::AddUniformMapping(Property::Index propertyIndex, std::string uniformName) const
{
// Get the address of the property if it's a scene property
const PropertyInputImpl* propertyPtr = GetSceneObjectInputProperty( propertyIndex );
{
const SceneGraph::PropertyOwner& sceneObject = GetSceneObject();
- OwnerPointer< SceneGraph::UniformPropertyMapping > map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr );
+ OwnerPointer<SceneGraph::UniformPropertyMapping> map =
+ new SceneGraph::UniformPropertyMapping(std::move(uniformName), propertyPtr);
// Message takes ownership of Uniform map (and will delete it after copy)
AddUniformMapMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), sceneObject, map );
}
* @param propertyIndex index of the property
* @param uniformName name of the uniform (same as property name)
*/
- void AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName ) const;
+ void AddUniformMapping(Property::Index propertyIndex, std::string uniformName) const;
/**
* Removes uniform mapping for given property
/**
* Constructor
*/
- UniformPropertyMapping( const std::string& theUniformName, const PropertyInputImpl* thePropertyPtr )
- : propertyPtr( thePropertyPtr ),
- uniformName( theUniformName ),
- uniformNameHash( Dali::CalculateHash( theUniformName ) )
+ UniformPropertyMapping(std::string theUniformName, const PropertyInputImpl* thePropertyPtr)
+ : propertyPtr(thePropertyPtr),
+ uniformName(std::move(theUniformName)),
+ uniformNameHash(Dali::CalculateHash(theUniformName))
{
}