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 | 7629e1f9ef7f9d2a3c345c97e6a4e5a4b32ee786 (patch) | |
tree | c3371bfa47641a52244267b63009d16e4e7054ff /contrib/libs | |
parent | cc573d2716c99ba22afc98753971cd97fd5283e0 (diff) | |
download | ydb-7629e1f9ef7f9d2a3c345c97e6a4e5a4b32ee786.tar.gz |
Restoring authorship annotation for <diver@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs')
-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 984d708dfa..7797d0beae 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; } |