diff --git a/alib2abstraction/src/registry/CastRegistry.cpp b/alib2abstraction/src/registry/CastRegistry.cpp index 089f7e3b59632cd6efab54f32c7e9765752b1b55..bf27b873dedf968d97de525dd3536679d604e4df 100644 --- a/alib2abstraction/src/registry/CastRegistry.cpp +++ b/alib2abstraction/src/registry/CastRegistry.cpp @@ -51,7 +51,7 @@ bool CastRegistry::isNoOp ( const std::string & target, const std::string & para bool CastRegistry::castAvailable ( const std::string & target, const std::string & param, bool implicitOnly ) { for ( const std::pair < const ext::pair < std::string, std::string >, std::unique_ptr < Entry > > & entry : getEntries ( ) ) if ( ( entry.first.second == param && ext::is_same_type ( target, ext::erase_template_info ( entry.first.first ) ) ) - && ( ! implicitOnly || ( implicitOnly && ! entry.second->isExplicit ( ) ) ) ) + && ( ! implicitOnly || ! entry.second->isExplicit ( ) ) ) return true; return false; diff --git a/alib2algo/src/automaton/run/Run.h b/alib2algo/src/automaton/run/Run.h index 4cc35caa49da37a56083cce1d0c423bb593bf288..4c6a05225ae1ce8cae416ebf14fe53cbe2a305a2 100644 --- a/alib2algo/src/automaton/run/Run.h +++ b/alib2algo/src/automaton/run/Run.h @@ -816,17 +816,11 @@ struct graphStructuredStack { template < class InputSymbolType, class OutputSymbolType, class PushdownStoreSymbolType, class StateType > ext::tuple < bool, ext::set < StateType >, ext::set < ext::vector < OutputSymbolType > > > Run::calculateStates ( const automaton::NPDTA < InputSymbolType, OutputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const string::LinearString < InputSymbolType > & string ) { bool res = false; - unsigned i = 0; - ext::set < unsigned > occurrences; StateType state = automaton . getInitialState (); typename ext::vector<InputSymbolType>::const_iterator symbolIter = string . getContent () . begin (); std::shared_ptr < graphStructuredStack < InputSymbolType > > stackNode = std::make_shared < graphStructuredStack < InputSymbolType > > ( nullptr, * symbolIter ); std::shared_ptr < graphStructuredStack < InputSymbolType > > outputNode = std::make_shared < graphStructuredStack < InputSymbolType > > ( nullptr, * symbolIter ); - if ( automaton . getFinalStates () . count ( state ) ) { - occurrences . insert ( i ); - } - ext::deque < ext::tuple < StateType, typename ext::vector<InputSymbolType>::const_iterator, std::shared_ptr < graphStructuredStack < InputSymbolType > >, std::shared_ptr < graphStructuredStack < InputSymbolType > > > > bftQueue; auto configuration = ext::make_tuple ( state, symbolIter, stackNode, outputNode ); bftQueue . push_back ( configuration ); diff --git a/alib2algo/src/string/naive/ExactCompare.h b/alib2algo/src/string/naive/ExactCompare.h index 14984522afeefd5528fb4998981a4cc9994637c6..2359b81218317688b51642f71273d4c2d36e4708 100644 --- a/alib2algo/src/string/naive/ExactCompare.h +++ b/alib2algo/src/string/naive/ExactCompare.h @@ -74,12 +74,11 @@ int ExactCompare::compare ( const string::CyclicString < SymbolType > & u, const int m = ( int ) v.getContent ( ).size ( ); int i = -1; int j = -1; - int k; bool last = false; while ( i < n - 1 && j < m - 1 ) { - k = 1; + int k = 1; while ( k <= n && u.getContent ( )[( i + k ) % n] == v.getContent ( )[( j + k ) % m] ) k++; diff --git a/alib2algo/src/string/naive/ExactEqual.h b/alib2algo/src/string/naive/ExactEqual.h index 8c8091e03955ecc052bdb9d52409644681653f97..b885af6481284f92e8b2654b4322d9bf31c9bb38 100644 --- a/alib2algo/src/string/naive/ExactEqual.h +++ b/alib2algo/src/string/naive/ExactEqual.h @@ -67,12 +67,11 @@ bool ExactEqual::equals ( const string::CyclicString < SymbolType > & u, const s int n = ( int ) u.getContent ( ).size ( ); int i = -1; int j = -1; - int k; if ( n != ( int ) v.getContent ( ).size ( ) ) return false; while ( i < n - 1 && j < n - 1 ) { - k = 1; + int k = 1; while ( k <= n && u.getContent ( )[( i + k ) % n] == v.getContent ( )[( j + k ) % n] ) k++; diff --git a/alib2algo_experimental/src/grammar/parsing/Follow.h b/alib2algo_experimental/src/grammar/parsing/Follow.h index d9c14621ea713729a712e8e053298e68d08bc392..67fd5637e03eab40982f11fdbdc56e45b5251f81 100644 --- a/alib2algo_experimental/src/grammar/parsing/Follow.h +++ b/alib2algo_experimental/src/grammar/parsing/Follow.h @@ -44,7 +44,7 @@ void Follow::follow ( const T & grammar, ext::map < NonterminalSymbolType, ext:: for ( const ext::vector < ext::variant < TerminalSymbolType, NonterminalSymbolType > > & rhs : rule.second ) // every nt in rhs is Y - for ( typename ext::vector < ext::variant < TerminalSymbolType, NonterminalSymbolType > >::const_iterator it = rhs.begin ( ); it != rhs.end ( ); it++ ) { + for ( typename ext::vector < ext::variant < TerminalSymbolType, NonterminalSymbolType > >::const_iterator it = rhs.begin ( ); it != rhs.end ( ); ++ it ) { const ext::variant < TerminalSymbolType, NonterminalSymbolType > & Y = * it; if ( ! grammar.getNonterminalAlphabet ( ).count ( Y ) )