From d6617d399f3428c43cf1094710e0a960d2784d62 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 26 Jul 2019 18:22:52 -0400 Subject: [PATCH] OGL/ProgramShaderCache: Use std::lock_guard deduction guides where applicable Same thing, less reading. --- Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index 65ee2437a4..144d35e5a5 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -519,7 +519,7 @@ PipelineProgram* ProgramShaderCache::GetPipelineProgram(const GLVertexFormat* ve geometry_shader ? geometry_shader->GetID() : 0, pixel_shader ? pixel_shader->GetID() : 0}; { - std::lock_guard guard(s_pipeline_program_lock); + std::lock_guard guard{s_pipeline_program_lock}; auto iter = s_pipeline_programs.find(key); if (iter != s_pipeline_programs.end()) { @@ -597,7 +597,7 @@ PipelineProgram* ProgramShaderCache::GetPipelineProgram(const GLVertexFormat* ve } // Lock to insert. A duplicate program may have been created in the meantime. - std::lock_guard guard(s_pipeline_program_lock); + std::lock_guard guard{s_pipeline_program_lock}; auto iter = s_pipeline_programs.find(key); if (iter != s_pipeline_programs.end()) { @@ -627,8 +627,8 @@ void ProgramShaderCache::ReleasePipelineProgram(PipelineProgram* prog) prog->shader.Destroy(); - std::lock_guard guard(s_pipeline_program_lock); - auto iter = s_pipeline_programs.find(prog->key); + std::lock_guard guard{s_pipeline_program_lock}; + const auto iter = s_pipeline_programs.find(prog->key); ASSERT(iter != s_pipeline_programs.end() && prog == iter->second.get()); s_pipeline_programs.erase(iter); }