Skip to content
Permalink
Browse files

OGL/ProgramShaderCache: Use std::lock_guard deduction guides where ap…

…plicable

Same thing, less reading.
  • Loading branch information...
lioncash committed Jul 26, 2019
1 parent 6e69e3c commit d6617d399f3428c43cf1094710e0a960d2784d62
Showing with 4 additions and 4 deletions.
  1. +4 −4 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<std::mutex> 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<std::mutex> 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<std::mutex> 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);
}

0 comments on commit d6617d3

Please sign in to comment.
You can’t perform that action at this time.