From 5108a78d36d9145d48562f9158b3f4f57723f06c Mon Sep 17 00:00:00 2001
From: Bhuvan Bezawada <bhuvan_777@outlook.com>
Date: Mon, 13 Aug 2018 09:56:37 +0100
Subject: [PATCH] Changed iterator to be a random access iterator

re #23145
---
 .../inc/MantidGeometry/Instrument/DetectorInfoIterator.h      | 2 +-
 Framework/Geometry/test/DetectorInfoIteratorTest.h            | 4 ++--
 .../mantid/geometry/src/Exports/DetectorInfo.cpp              | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfoIterator.h b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfoIterator.h
index 322ff622ec3..2a4decd5623 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfoIterator.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfoIterator.h
@@ -45,7 +45,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org>
 class MANTID_GEOMETRY_DLL DetectorInfoIterator
     : public boost::iterator_facade<DetectorInfoIterator,
                                     const DetectorInfoItem &,
-                                    boost::bidirectional_traversal_tag> {
+                                    boost::random_access_traversal_tag> {
 
 public:
   DetectorInfoIterator(const DetectorInfo &detectorInfo, const size_t index)
diff --git a/Framework/Geometry/test/DetectorInfoIteratorTest.h b/Framework/Geometry/test/DetectorInfoIteratorTest.h
index b58dc886b95..418fe374214 100644
--- a/Framework/Geometry/test/DetectorInfoIteratorTest.h
+++ b/Framework/Geometry/test/DetectorInfoIteratorTest.h
@@ -151,8 +151,8 @@ public:
     std::advance(iter, -2);
     TS_ASSERT_EQUALS(iter->getIndex(), 9);
 
-    // Go past the start
-    std::advance(iter, -100);
+    // Go to the start
+    std::advance(iter, -9);
     TS_ASSERT(iter == detectorInfo->begin());
   }
 
diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfo.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfo.cpp
index 6cc4bbd73fc..f7091c47ccf 100644
--- a/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfo.cpp
+++ b/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfo.cpp
@@ -26,7 +26,7 @@ using namespace boost::python;
 // Helper method to make the python iterator
 DetectorInfoPythonIterator make_pyiterator(const DetectorInfo &detectorInfo) {
   return DetectorInfoPythonIterator(detectorInfo);
-};
+}
 
 // Export DetectorInfo
 void export_DetectorInfo() {
-- 
GitLab