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

clang-tidy: empty vs size == 0 or > 0

parent efb3f915
No related branches found
No related tags found
2 merge requests!181Clang tidy fixes merge,!180Clang tidy fixes merge
......@@ -91,7 +91,7 @@ private:
 
template < class T, class SymbolType, class StateType >
rte::FormalRTE< ext::variant< SymbolType, StateType > > ToRTEStateElimination::convert ( const T& automaton ) {
if ( automaton.getFinalStates ( ).size ( ) == 0 )
if ( automaton.getFinalStates ( ).empty ( ) )
return rte::FormalRTE< ext::variant< SymbolType, StateType > > ( );
 
// create an automaton, extend it with a new final state
......@@ -119,7 +119,7 @@ rte::FormalRTE< ext::variant< SymbolType, StateType > > ToRTEStateElimination::c
 
template < class SymbolType, class StateType >
rte::FormalRTEStructure< ext::variant< SymbolType, StateType > > ToRTEStateElimination::createAlternation ( const ext::vector< ext::pair< ext::pair< rte::FormalRTEStructure< ext::variant< SymbolType, StateType > >, ext::vector< StateType > >, StateType > >& transitions ) {
if ( transitions.size ( ) == 0 )
if ( transitions.empty ( ) )
return rte::FormalRTEStructure< ext::variant< SymbolType, StateType > > ( rte::FormalRTEEmpty< ext::variant< SymbolType, StateType > > ( ) );
if ( transitions.size ( ) == 1 )
return transitions.at ( 0 ).first.first;
......
......@@ -214,7 +214,7 @@ void LatexConverter::rules ( std::ostream & out, const grammar::CFG < TerminalSy
for ( const auto & kv : grammar.getRules ( ) ) {
const auto & lhs = kv.first;
 
if ( kv.second.size ( ) > 0 )
if ( ! kv.second.empty ( ) )
out << replace ( factory::StringDataFactory::toString ( lhs ), "\"", "\\\"" ) << " & \\rightarrow & ";
 
for ( auto itRhs = kv.second.begin ( ); itRhs != kv.second.end ( ); ++ itRhs ) {
......@@ -239,7 +239,7 @@ void LatexConverter::rules ( std::ostream & out, const grammar::RightRG < Termin
for ( const auto & kv : grammar.getRules ( ) ) {
const NonterminalSymbolType & lhs = kv.first;
 
if ( kv.second.size ( ) > 0 )
if ( ! kv.second.empty ( ) )
out << replace ( factory::StringDataFactory::toString ( lhs ), "\"", "\\\"" ) << " & \\rightarrow & ";
 
for ( auto itRhs = kv.second.begin ( ); itRhs != kv.second.end ( ); ++ itRhs ) {
......
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