From fd14dad7897e0c80836b33d2ed281bb4da0b551a Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 20 Aug 2020 03:01:43 +0100 Subject: [PATCH] const osg::ref_ptf reference should be faster than value as constructor and destructor are non-trivial I played around in GodBolt and got into an argument to determine this. The difference will be immeasurably small, but my curiosity has been satisfied. --- components/sceneutil/mwshadowtechnique.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp index 7a435fe905..dc22d4d806 100644 --- a/components/sceneutil/mwshadowtechnique.cpp +++ b/components/sceneutil/mwshadowtechnique.cpp @@ -2988,7 +2988,7 @@ osg::StateSet* MWShadowTechnique::selectStateSetForRenderingShadow(ViewDependent stateset->setTextureAttributeAndModes(0, _fallbackBaseTexture.get(), osg::StateAttribute::ON); - for(auto uniform : _uniforms[traversalNumber % 2]) + for(const auto& uniform : _uniforms[traversalNumber % 2]) { OSG_INFO<<"addUniform("<getName()<<")"<addUniform(uniform);