From 0f67cbb8cdb8e343fd0d334d3133e2384cf89139 Mon Sep 17 00:00:00 2001
From: Dominik Smith <smith@th.physik.uni-frankfurt.de>
Date: Thu, 29 Jul 2021 16:11:59 +0200
Subject: [PATCH] Bug fix: Added missing break statement to loops in
 CbmAlgoBuildRawEvents::SetReferenceDetector() and
 CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector().

---
 fles/mcbm2018/tasks/CbmMcbm2019TimeWinEventBuilderAlgo.cxx | 1 +
 reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/fles/mcbm2018/tasks/CbmMcbm2019TimeWinEventBuilderAlgo.cxx b/fles/mcbm2018/tasks/CbmMcbm2019TimeWinEventBuilderAlgo.cxx
index ce5a726aed..7bf841134e 100644
--- a/fles/mcbm2018/tasks/CbmMcbm2019TimeWinEventBuilderAlgo.cxx
+++ b/fles/mcbm2018/tasks/CbmMcbm2019TimeWinEventBuilderAlgo.cxx
@@ -721,6 +721,7 @@ void CbmMcbm2019TimeWinEventBuilderAlgo::SetReferenceDetector(EventBuilderDetect
                       "Please also remember to update the selection windows to store "
                       "clusters!";
       RemoveDetector(refDetIn);
+      break;
     }  // if( (*det)  == refDetIn )
   }    // for( std::vector< EventBuilderDetector >::iterator det = fvDets.begin(); det != fvDets.end(); ++det )
 
diff --git a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx
index c08de068c7..b2b4fbd98c 100644
--- a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx
+++ b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx
@@ -798,6 +798,7 @@ void CbmAlgoBuildRawEvents::SetReferenceDetector(RawEventBuilderDetector refDetI
                       "Please also remember to update the selection windows to store "
                       "clusters!";
       RemoveDetector(refDetIn);
+      break;
     }
   }
 
-- 
GitLab