From 39c2fdb943d0f8e684e957762b90764840641bec Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Tue, 26 Oct 2021 22:59:02 +0200 Subject: [PATCH] nvidia/vfx: Optimize by returning a const-reference Prevents a needless deep clone of the path object. --- source/nvidia/vfx/nvidia-vfx.cpp | 2 +- source/nvidia/vfx/nvidia-vfx.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/nvidia/vfx/nvidia-vfx.cpp b/source/nvidia/vfx/nvidia-vfx.cpp index c4c925d4..cdaa0800 100644 --- a/source/nvidia/vfx/nvidia-vfx.cpp +++ b/source/nvidia/vfx/nvidia-vfx.cpp @@ -220,7 +220,7 @@ std::shared_ptr<::streamfx::nvidia::vfx::vfx> streamfx::nvidia::vfx::vfx::get() return instance.lock(); } -std::filesystem::path streamfx::nvidia::vfx::vfx::model_path() +std::filesystem::path const& streamfx::nvidia::vfx::vfx::model_path() { return _model_path; } diff --git a/source/nvidia/vfx/nvidia-vfx.hpp b/source/nvidia/vfx/nvidia-vfx.hpp index fd575434..217eaff1 100644 --- a/source/nvidia/vfx/nvidia-vfx.hpp +++ b/source/nvidia/vfx/nvidia-vfx.hpp @@ -71,7 +71,7 @@ namespace streamfx::nvidia::vfx { ~vfx(); vfx(); - std::filesystem::path model_path(); + std::filesystem::path const& model_path(); public: NVVFX_DEFINE_FUNCTION(NvVFX_GetVersion, uint32_t* version);