From a21ec725cbf824578aeb016c55fe514da8202737 Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Sat, 21 Mar 2020 15:37:00 +0100
Subject: [PATCH] Removed checks in get...Iterator

---
 reading_machine/src/Config.cpp    | 4 ----
 reading_machine/src/SubConfig.cpp | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/reading_machine/src/Config.cpp b/reading_machine/src/Config.cpp
index 902b1cd..ab35b3a 100644
--- a/reading_machine/src/Config.cpp
+++ b/reading_machine/src/Config.cpp
@@ -319,15 +319,11 @@ const Config::String & Config::getLastNotEmptyHypConst(const std::string & colNa
 
 Config::ValueIterator Config::getIterator(int colIndex, int lineIndex, int hypothesisIndex)
 {
-  if (!has(colIndex, lineIndex, 0))
-    util::myThrow(fmt::format("asked for line {} but nbLines = {}", lineIndex, getNbLines()));
   return lines.begin() + getIndexOfLine(lineIndex-getFirstLineIndex()) + getIndexOfCol(colIndex) + hypothesisIndex;
 }
 
 Config::ConstValueIterator Config::getConstIterator(int colIndex, int lineIndex, int hypothesisIndex) const
 {
-  if (!has(colIndex, lineIndex, 0))
-    util::myThrow(fmt::format("asked for line {} but nbLines = {}", lineIndex, getNbLines()));
   return lines.begin() + getIndexOfLine(lineIndex-getFirstLineIndex()) + getIndexOfCol(colIndex) + hypothesisIndex;
 }
 
diff --git a/reading_machine/src/SubConfig.cpp b/reading_machine/src/SubConfig.cpp
index 8ad29d3..1b63ed2 100644
--- a/reading_machine/src/SubConfig.cpp
+++ b/reading_machine/src/SubConfig.cpp
@@ -37,7 +37,7 @@ bool SubConfig::update()
 
     while (firstToSave != lastToSave)
       *linesBegin++ = *firstToSave++;
-  } // The new window is a bit shifted to the write, we will keep the lasts elements from old window
+  } // The new window is a bit shifted to the right, we will keep the lasts elements from old window
   else if (currentLastLineIndex > newFirstLineIndex and currentLastLineIndex < newLastLineIndex)
   {
     auto linesBegin = getIterator(0, firstLineIndex, 0);
-- 
GitLab