From db1d86de53e66d12fbbee07fc44217bed8e8ab37 Mon Sep 17 00:00:00 2001
From: Harry Jeffery <henry.jeffery@stfc.ac.uk>
Date: Mon, 9 Feb 2015 15:04:25 +0000
Subject: [PATCH] Refs #11014 Resolves Coverity 1075574

---
 Code/Mantid/Framework/MDEvents/src/Integrate3DEvents.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Code/Mantid/Framework/MDEvents/src/Integrate3DEvents.cpp b/Code/Mantid/Framework/MDEvents/src/Integrate3DEvents.cpp
index 21ccb91ccf7..8d1c98496f7 100644
--- a/Code/Mantid/Framework/MDEvents/src/Integrate3DEvents.cpp
+++ b/Code/Mantid/Framework/MDEvents/src/Integrate3DEvents.cpp
@@ -34,11 +34,10 @@ Integrate3DEvents::Integrate3DEvents(std::vector<V3D> const &peak_q_list,
   this->radius = radius;
 
   int64_t hkl_key;
-  for (size_t i = 0; i < peak_q_list.size(); i++) {
-    hkl_key = getHklKey(peak_q_list[i]);
-
+  for (auto it = peak_q_list.begin(); it != peak_q_list.end(); ++it) {
+    hkl_key = getHklKey(*it);
     if (hkl_key != 0) // only save if hkl != (0,0,0)
-      peak_qs[hkl_key] = peak_q_list[i];
+      peak_qs[hkl_key] = *it;
   }
 }
 
-- 
GitLab