From 5694a281e3efc13a62dc43ced9c7459724d01b23 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 21 Aug 2022 13:42:48 +0100 Subject: Reduce variable scope --- gfx/gl/glSource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/gl/glSource.cpp b/gfx/gl/glSource.cpp index 49773d0..962d096 100644 --- a/gfx/gl/glSource.cpp +++ b/gfx/gl/glSource.cpp @@ -18,7 +18,6 @@ void GLsource::CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage) { GLint success = 0; - std::array error {}; if (isProgram) { glGetProgramiv(shader, flag, &success); @@ -28,6 +27,7 @@ GLsource::CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::stri } if (success == GL_FALSE) { + std::array error {}; if (isProgram) { glGetProgramInfoLog(shader, error.size(), nullptr, error.data()); } -- cgit v1.2.3