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
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment