From f00f0353a63fafb8f82e91e1923f57093eb6e5e9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 15 Nov 2017 21:48:10 -0500 Subject: [PATCH] Removes unnecessary temporaries. --- Outputs/CRT/Internals/Shaders/IntermediateShader.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp index 446e02edc..db2373c27 100644 --- a/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp +++ b/Outputs/CRT/Internals/Shaders/IntermediateShader.cpp @@ -102,9 +102,7 @@ std::unique_ptr IntermediateShader::make_shader(const std::s "gl_Position = vec4(eyePosition, 0.0, 1.0);" "}"; - std::unique_ptr shader(new IntermediateShader(vertex_shader.str(), fragment_shader, bindings)); - - return shader; + return std::unique_ptr(new IntermediateShader(vertex_shader.str(), fragment_shader, bindings)); } std::unique_ptr IntermediateShader::make_source_conversion_shader(const std::string &composite_shader, const std::string &rgb_shader) { @@ -143,9 +141,7 @@ std::unique_ptr IntermediateShader::make_source_conversion_s "fragColour = vec4(composite_sample(texID, inputPositionsVarying[5], iInputPositionVarying, phaseAndAmplitudeVarying.x, phaseAndAmplitudeVarying.y));" "}"; - std::unique_ptr shader = make_shader(fragment_shader.str(), true, true); - - return shader; + return make_shader(fragment_shader.str(), true, true); } std::unique_ptr IntermediateShader::make_rgb_source_shader(const std::string &rgb_shader) { @@ -168,9 +164,7 @@ std::unique_ptr IntermediateShader::make_rgb_source_shader(c "fragColour = rgb_sample(texID, inputPositionsVarying[5], iInputPositionVarying);" "}"; - std::unique_ptr shader = make_shader(fragment_shader.str(), true, true); - - return shader; + return make_shader(fragment_shader.str(), true, true); } std::unique_ptr IntermediateShader::make_chroma_luma_separation_shader() {