Skip to content
Snippets Groups Projects
Commit a21ec725 authored by Franck Dary's avatar Franck Dary
Browse files

Removed checks in get...Iterator

parent a1fc02b9
Branches
No related tags found
No related merge requests found
...@@ -319,15 +319,11 @@ const Config::String & Config::getLastNotEmptyHypConst(const std::string & colNa ...@@ -319,15 +319,11 @@ const Config::String & Config::getLastNotEmptyHypConst(const std::string & colNa
Config::ValueIterator Config::getIterator(int colIndex, int lineIndex, int hypothesisIndex) 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; return lines.begin() + getIndexOfLine(lineIndex-getFirstLineIndex()) + getIndexOfCol(colIndex) + hypothesisIndex;
} }
Config::ConstValueIterator Config::getConstIterator(int colIndex, int lineIndex, int hypothesisIndex) const 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; return lines.begin() + getIndexOfLine(lineIndex-getFirstLineIndex()) + getIndexOfCol(colIndex) + hypothesisIndex;
} }
......
...@@ -37,7 +37,7 @@ bool SubConfig::update() ...@@ -37,7 +37,7 @@ bool SubConfig::update()
while (firstToSave != lastToSave) while (firstToSave != lastToSave)
*linesBegin++ = *firstToSave++; *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) else if (currentLastLineIndex > newFirstLineIndex and currentLastLineIndex < newLastLineIndex)
{ {
auto linesBegin = getIterator(0, firstLineIndex, 0); auto linesBegin = getIterator(0, firstLineIndex, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment