From eafa2eabdad4570e0ca51b2d88dff93730e8655e Mon Sep 17 00:00:00 2001
From: Elliot Oram <Elliot.Oram@stfc.ac.uk>
Date: Thu, 30 Jul 2015 14:49:10 +0100
Subject: [PATCH] Reduce the Scope of subIndex in createFunction

Refs #12669
---
 .../Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
index 8159cd7dfc4..e43260fbd22 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
@@ -514,8 +514,6 @@ CompositeFunction_sptr ConvFit::createFunction(bool tieCentres) {
 
   bool useDeltaFunc = m_blnManager->value(m_properties["UseDeltaFunc"]);
 
-  size_t subIndex = 0;
-
   if (useDeltaFunc) {
     func = FunctionFactory::Instance().createFunction("DeltaFunction");
     index = model->addFunction(func);
@@ -542,12 +540,14 @@ CompositeFunction_sptr ConvFit::createFunction(bool tieCentres) {
 
   int fitTypeIndex = m_uiForm.cbFitType->currentIndex();
   if (fitTypeIndex > 0) {
+    size_t subIndex = 0;
     auto product = boost::dynamic_pointer_cast<CompositeFunction>(
         FunctionFactory::Instance().createFunction("ProductFunction"));
 
     if (useTempCorrection) {
       createTemperatureCorrection(product);
     }
+
     // Add 1st Lorentzian
 
     // if temperature not included then product is lorentzian * 1
-- 
GitLab