From 399478c2cdaad6164c166a989a11c8331f02e404 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 29 Nov 2015 18:20:43 +0100 Subject: [PATCH] gl: Use const and ref for loops in GLFragmentProgram.cpp --- rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index 75b7a9ab10..3ece495c60 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -33,9 +33,9 @@ void GLFragmentDecompilerThread::insertHeader(std::stringstream & OS) void GLFragmentDecompilerThread::insertIntputs(std::stringstream & OS) { - for (ParamType PT : m_parr.params[PF_PARAM_IN]) + for (const ParamType& PT : m_parr.params[PF_PARAM_IN]) { - for (ParamItem PI : PT.items) + for (const ParamItem& PI : PT.items) OS << "in " << PT.type << " " << PI.name << ";" << std::endl; } } @@ -59,22 +59,22 @@ void GLFragmentDecompilerThread::insertOutputs(std::stringstream & OS) void GLFragmentDecompilerThread::insertConstants(std::stringstream & OS) { - for (ParamType PT : m_parr.params[PF_PARAM_UNIFORM]) + for (const ParamType& PT : m_parr.params[PF_PARAM_UNIFORM]) { if (PT.type != "sampler2D") continue; - for (ParamItem PI : PT.items) + for (const ParamItem& PI : PT.items) OS << "uniform " << PT.type << " " << PI.name << ";" << std::endl; } OS << "layout(std140, binding = 2) uniform FragmentConstantsBuffer" << std::endl; OS << "{" << std::endl; - for (ParamType PT : m_parr.params[PF_PARAM_UNIFORM]) + for (const ParamType& PT : m_parr.params[PF_PARAM_UNIFORM]) { if (PT.type == "sampler2D") continue; - for (ParamItem PI : PT.items) + for (const ParamItem& PI : PT.items) OS << " " << PT.type << " " << PI.name << ";" << std::endl; } // A dummy value otherwise it's invalid to create an empty uniform buffer @@ -87,9 +87,9 @@ void GLFragmentDecompilerThread::insertMainStart(std::stringstream & OS) OS << "void main ()" << std::endl; OS << "{" << std::endl; - for (ParamType PT : m_parr.params[PF_PARAM_NONE]) + for (const ParamType& PT : m_parr.params[PF_PARAM_NONE]) { - for (ParamItem PI : PT.items) + for (const ParamItem& PI : PT.items) { OS << " " << PT.type << " " << PI.name; if (!PI.value.empty()) @@ -158,7 +158,7 @@ void GLFragmentProgram::Decompile(RSXFragmentProgram& prog) decompiler.Task(); for (const ParamType& PT : decompiler.m_parr.params[PF_PARAM_UNIFORM]) { - for (const ParamItem PI : PT.items) + for (const ParamItem& PI : PT.items) { if (PT.type == "sampler2D") continue;