diff options
author | diver <diver@yandex-team.ru> | 2022-02-10 16:48:07 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:07 +0300 |
commit | e20e2b362f0232ed5a389db887e6e27e7763af18 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /contrib/libs/pire | |
parent | 7629e1f9ef7f9d2a3c345c97e6a4e5a4b32ee786 (diff) | |
download | ydb-e20e2b362f0232ed5a389db887e6e27e7763af18.tar.gz |
Restoring authorship annotation for <diver@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/pire')
-rw-r--r-- | contrib/libs/pire/pire/fsm.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/contrib/libs/pire/pire/fsm.cpp b/contrib/libs/pire/pire/fsm.cpp index 7797d0beae..984d708dfa 100644 --- a/contrib/libs/pire/pire/fsm.cpp +++ b/contrib/libs/pire/pire/fsm.cpp @@ -981,28 +981,28 @@ public: mNewFsm.Connect(from, to, letter); } typedef bool Result; - - Result Success() { - Fsm::Outputs oldOutputs; - // remove redundant outputs - oldOutputs.swap(mNewFsm.outputs); - for (size_t from = 0; from < mNewFsm.Size(); ++from) { + + Result Success() { + Fsm::Outputs oldOutputs; + // remove redundant outputs + oldOutputs.swap(mNewFsm.outputs); + for (size_t from = 0; from < mNewFsm.Size(); ++from) { auto fromOutput = oldOutputs.find(from); - if (fromOutput == oldOutputs.end()) - continue; + if (fromOutput == oldOutputs.end()) + continue; const auto& newTransitionsRow = mNewFsm.m_transitions[from]; for (auto&& row : newTransitionsRow) { for (auto&& stateIt : row.second) { auto toOutput = fromOutput->second.find(stateIt); - if (toOutput != fromOutput->second.end()) { - mNewFsm.outputs[from].insert(*toOutput); - } - } - } - } - return true; - } - + if (toOutput != fromOutput->second.end()) { + mNewFsm.outputs[from].insert(*toOutput); + } + } + } + } + return true; + } + Result Failure() { return false; } Fsm& Output() { return mNewFsm; } |