Skip to content
Snippets Groups Projects
Commit 02fa82d5 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

add some const references in determinisation algo

parent 6f09e711
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ void ret(const DefaultStateType& state, const DefaultSymbolType& pdaSymbol, cons
 
const DefaultStateType& q = std::get<0>(transition.first);
for(const auto& to : transition.second) {
const DefaultStateType q1 = to.first;
const DefaultStateType& q1 = to.first;
const DefaultSymbolType& gamma = to.second;
 
for(const auto& entry : S) {
......@@ -159,14 +159,14 @@ void local(const DefaultStateType& state, const std::variant<DefaultEpsilonType,
std::set<std::pair<DefaultStateType, DefaultStateType>> S1;
 
for(const auto& entry : S) {
DefaultStateType q = entry.first;
DefaultStateType q2 = entry.second;
const DefaultStateType & q = entry.first;
const DefaultStateType & q2 = entry.second;
for(const auto& transition : nondeterministic.getLocalTransitions()) {
if(q2 != transition.first.first) continue;
if(input != transition.first.second) continue;
 
for(const auto& to : transition.second) {
DefaultStateType q1 = to;
const DefaultStateType & q1 = to;
 
S1.insert(std::make_pair(q, q1));
}
......
......@@ -57,7 +57,7 @@ void ret(const DefaultStateType& state, const DefaultSymbolType& pdaSymbol, cons
 
const DefaultStateType& q = std::get<0>(transition.first);
for(const auto& to : transition.second) {
const DefaultStateType q1 = to.first;
const DefaultStateType& q1 = to.first;
const DefaultSymbolType& gamma = to.second;
 
for(const auto& entry : S) {
......@@ -137,14 +137,14 @@ void local(const DefaultStateType& state, const DefaultSymbolType& input, const
std::set<std::pair<DefaultStateType, DefaultStateType>> S1;
 
for(const auto& entry : S) {
DefaultStateType q = entry.first;
DefaultStateType q2 = entry.second;
const DefaultStateType & q = entry.first;
const DefaultStateType & q2 = entry.second;
for(const auto& transition : nondeterministic.getLocalTransitions()) {
if(q2 != transition.first.first) continue;
if(input != transition.first.second) continue;
 
for(const auto& to : transition.second) {
DefaultStateType q1 = to;
const DefaultStateType & q1 = to;
 
S1.insert(std::make_pair(q, q1));
}
......
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