diff --git a/reading_machine/src/Strategy.cpp b/reading_machine/src/Strategy.cpp index ea537e09d2dcb91730289a72e8e67099bdad9d57..14853d318fdfc204d877338e8b0a3de606c590b1 100644 --- a/reading_machine/src/Strategy.cpp +++ b/reading_machine/src/Strategy.cpp @@ -65,7 +65,7 @@ std::pair<std::string, int> Strategy::getMovementSequential(const Config & c, co auto foundGeneric = edges.find(std::make_pair(c.getState(), "")); std::string target; - int movement; + int movement = -1; if (foundSpecific != edges.end()) { @@ -82,7 +82,7 @@ std::pair<std::string, int> Strategy::getMovementSequential(const Config & c, co util::myThrow(fmt::format("no suitable movement found for current state '{}' and transition '{}'", c.getState(), transition)); if (!c.stateIsDone()) - return {c.getState(), (c.getState() == target) && edges.size() > 1 ? movement : 0}; + return {c.getState(), movement}; if (!isDone[target]) return {target, -c.getWordIndex()};