From 828c40c710f798ea60937bdd6045809b6c2362ec Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 7 Jan 2024 18:52:10 +0400 Subject: [PATCH] Do not copy due to auto misuse --- apps/launcher/graphicspage.cpp | 2 +- components/stereo/stereomanager.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index fa9d5eb479..b360c215e6 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -154,7 +154,7 @@ bool Launcher::GraphicsPage::loadSettings() if (Settings::shadows().mEnableIndoorShadows) indoorShadowsCheckBox->setCheckState(Qt::Checked); - auto boundMethod = Settings::shadows().mComputeSceneBounds.get(); + const auto& boundMethod = Settings::shadows().mComputeSceneBounds.get(); if (boundMethod == "bounds") shadowComputeSceneBoundsComboBox->setCurrentIndex(0); else if (boundMethod == "primitives") diff --git a/components/stereo/stereomanager.cpp b/components/stereo/stereomanager.cpp index a2eea0fda2..c3d7f1d320 100644 --- a/components/stereo/stereomanager.cpp +++ b/components/stereo/stereomanager.cpp @@ -315,8 +315,7 @@ namespace Stereo else { auto* ds = osg::DisplaySettings::instance().get(); - auto viewMatrix = mMainCamera->getViewMatrix(); - auto projectionMatrix = mMainCamera->getProjectionMatrix(); + const auto& projectionMatrix = mMainCamera->getProjectionMatrix(); auto s = ds->getEyeSeparation() * Constants::UnitsPerMeter; mViewOffsetMatrix[0] = osg::Matrixd(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, s, 0.0, 0.0, 1.0);