Skip to content
Snippets Groups Projects
Commit a1532429 authored by Jan Travnicek's avatar Jan Travnicek
Browse files

fix readability-simplify-boolean-expr

parent ab4ed6b9
No related branches found
No related tags found
1 merge request!95Many clang-tidy fixes
......@@ -16,7 +16,7 @@ size_t RandomAutomatonFactory2::randomSourceState ( size_t statesMinimal, size_t
size_t y = ext::random_devices::semirandom() % ( visited - depleted ) + 1; // select y-th accessible state
 
for( size_t i = 0, cnt = 0; i < statesMinimal; i++ ) {
if( VStates [ i ] == true && DStates [ i ] == false )
if( VStates [ i ] && ! DStates [ i ] )
cnt ++;
 
if( cnt == y )
......@@ -27,10 +27,10 @@ size_t RandomAutomatonFactory2::randomSourceState ( size_t statesMinimal, size_t
}
 
size_t RandomAutomatonFactory2::randomTargetState ( size_t statesMinimal, size_t visited, const ext::deque < bool > & VStates ) {
size_t z = ext::random_devices::semirandom() % ( statesMinimal - visited ) + 1; // select z-th inaccessible state
size_t z = ext::random_devices::semirandom() % ( statesMinimal - visited ) + 1; // select z-th inaccessible state
 
for( size_t i = 0, cnt = 0; i < statesMinimal; i++ ) {
if( VStates[ i ] == false )
if( ! VStates[ i ] )
cnt ++;
 
if( cnt == z )
......
......@@ -116,7 +116,7 @@ automaton::DFA < SymbolType, unsigned > RandomAutomatonFactory2::NonminimalDFA(
visited = 1;
VStates[ 0 ] = true;
DStates[ 0 ] = automaton.getTransitionsFromState ( 0 ).size ( ) == alphabet.size ( );
if ( DStates[ 0 ] == true )
if ( DStates[ 0 ] )
depleted ++;
} else {
size_t x = ( ext::random_devices::semirandom() % ( statesMinimal - 1 ) ) + 1;
......@@ -127,7 +127,7 @@ automaton::DFA < SymbolType, unsigned > RandomAutomatonFactory2::NonminimalDFA(
VStates[ x ] = true;
 
DStates[ 0 ] = automaton.getTransitionsFromState ( 0 ).size ( ) == alphabet.size ( );
if ( DStates[ 0 ] == true )
if ( DStates[ 0 ] )
depleted ++;
}
 
......@@ -142,7 +142,7 @@ automaton::DFA < SymbolType, unsigned > RandomAutomatonFactory2::NonminimalDFA(
visited ++;
VStates[ b ] = true;
DStates[ a ] = automaton.getTransitionsFromState ( a ).size ( ) == alphabet.size ( );
if ( DStates[ a ] == true )
if ( DStates[ a ] )
depleted ++;
}
 
......@@ -157,7 +157,7 @@ automaton::DFA < SymbolType, unsigned > RandomAutomatonFactory2::NonminimalDFA(
visited ++;
VStates[ b ] = true;
DStates[ a ] = automaton.getTransitionsFromState ( a ).size ( ) == alphabet.size ( );
if ( DStates[ a ] == true )
if ( DStates[ a ] )
depleted ++;
}
 
......@@ -218,7 +218,7 @@ automaton::DFA < SymbolType, unsigned > RandomAutomatonFactory2::NonminimalDFA(
 
addTransition( automaton, a, alphabet [ c ], b, duplicates );
DStates[ a ] = automaton.getTransitionsFromState ( a ).size ( ) == alphabet.size ( );
if ( DStates[ a ] == true )
if ( DStates[ a ] )
depleted ++;
}
 
......
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