Skip to content
Snippets Groups Projects
Commit 9fef919c authored by Jan Travnicek's avatar Jan Travnicek Committed by Jan Trávníček
Browse files

fix unintended pass by value

parent caf45a77
No related branches found
No related tags found
1 merge request!95Many clang-tidy fixes
......@@ -284,7 +284,7 @@ public:
*
* \returns true if the transition was indeed removed
*/
bool removeTransition ( const common::ranked_symbol < SymbolType, RankType > symbol, const ext::vector < StateType > & states, const StateType & next );
bool removeTransition ( const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::vector < StateType > & states, const StateType & next );
 
/**
* Get the transition function of the automaton in its natural form.
......@@ -430,7 +430,7 @@ bool DFTA < SymbolType, RankType, StateType >::addTransition ( common::ranked_sy
}
 
template<class SymbolType, class RankType, class StateType >
bool DFTA < SymbolType, RankType, StateType >::removeTransition(const common::ranked_symbol < SymbolType, RankType > symbol, const ext::vector<StateType> & states, const StateType & next) {
bool DFTA < SymbolType, RankType, StateType >::removeTransition(const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::vector<StateType> & states, const StateType & next) {
ext::pair<common::ranked_symbol < SymbolType, RankType >, ext::vector<StateType> > key = ext::make_pair(symbol, states);
 
if ( transitions.find ( key ) == transitions.end ( ) )
......
......@@ -309,7 +309,7 @@ public:
*
* \returns true if the transition was indeed removed
*/
bool removeTransition ( const rte::FormalRTEStructure < ext::variant < SymbolType, StateType >, RankType > rte, const ext::vector < StateType > & prevStates, const StateType& next );
bool removeTransition ( const rte::FormalRTEStructure < ext::variant < SymbolType, StateType >, RankType > & rte, const ext::vector < StateType > & prevStates, const StateType& next );
 
/**
* Get the transition function of the automaton in its natural form.
......@@ -475,7 +475,7 @@ void ExtendedNFTA < SymbolType, RankType, StateType >::addTransitions ( rte::For
}
 
template < class SymbolType, class RankType, class StateType >
bool ExtendedNFTA < SymbolType, RankType, StateType >::removeTransition ( const rte::FormalRTEStructure < ext::variant < SymbolType, StateType >, RankType > rte, const ext::vector < StateType > & prevStates, const StateType& next ) {
bool ExtendedNFTA < SymbolType, RankType, StateType >::removeTransition ( const rte::FormalRTEStructure < ext::variant < SymbolType, StateType >, RankType > & rte, const ext::vector < StateType > & prevStates, const StateType& next ) {
ext::pair < rte::FormalRTEStructure < ext::variant < SymbolType, StateType >, RankType >, ext::vector < StateType > > key = ext::make_pair ( rte, prevStates );
return transitions [ key ].erase ( next );
}
......
......@@ -289,7 +289,7 @@ public:
*
* \returns true if the transition was indeed removed
*/
bool removeTransition ( const common::ranked_symbol < SymbolType, RankType > symbol, const ext::vector < StateType > & states, const StateType & next );
bool removeTransition ( const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::vector < StateType > & states, const StateType & next );
 
/**
* Get the transition function of the automaton in its natural form.
......@@ -448,7 +448,7 @@ bool NFTA < SymbolType, RankType, StateType >::addTransition ( common::ranked_sy
}
 
template < class SymbolType, class RankType, class StateType >
bool NFTA < SymbolType, RankType, StateType >::removeTransition(const common::ranked_symbol < SymbolType, RankType > symbol, const ext::vector<StateType> & states, const StateType & next) {
bool NFTA < SymbolType, RankType, StateType >::removeTransition(const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::vector<StateType> & states, const StateType & next) {
auto upper_bound = transitions.upper_bound ( ext::tie ( symbol, states ) );
auto lower_bound = transitions.lower_bound ( ext::tie ( symbol, states ) );
auto iter = std::find_if ( lower_bound, upper_bound, [ & ] ( const auto & transition ) { return transition.second == next; } );
......
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