Skip to content

Commit f0c9806

Browse files
author
Fytch
committed
improve readability
1 parent 850d4d6 commit f0c9806

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

ProgramOptions.hxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,17 +1793,17 @@ namespace po {
17931793

17941794
public:
17951795
bool wellformed() const {
1796-
for( auto&& i : m_options ) {
1797-
if( !valid_designator( i.first ) )
1796+
for( auto&& opt : m_options ) {
1797+
if( !valid_designator( opt.first ) )
17981798
return false;
1799-
if( i.first.size() == 0 && i.second.get_abbreviation() != '\0' )
1799+
if( opt.first.size() == 0 && opt.second.get_abbreviation() != '\0' )
18001800
return false;
1801-
if( i.first.size() == 1 && i.second.get_abbreviation() != i.first[ 0 ] )
1801+
if( opt.first.size() == 1 && opt.second.get_abbreviation() != opt.first[ 0 ] )
18021802
return false;
18031803
}
18041804
std::string abbreviations;
1805-
for( auto&& i : m_options )
1806-
if( char a = i.second.get_abbreviation() )
1805+
for( auto&& opt : m_options )
1806+
if( char a = opt.second.get_abbreviation() )
18071807
abbreviations.push_back( a );
18081808
std::sort( abbreviations.begin(), abbreviations.end() );
18091809
if( std::adjacent_find( abbreviations.begin(), abbreviations.end() ) != abbreviations.end() )
@@ -1813,7 +1813,8 @@ namespace po {
18131813

18141814
bool operator()( int int_argc, char** argv ) {
18151815
PROGRAMOPTIONS_ASSERT( wellformed(), "cannot parse with an ill-formed parser" );
1816-
PROGRAMOPTIONS_ASSERT( std::none_of( m_options.begin(), m_options.end(), []( options_t::value_type const& x ){ return x.second.was_set(); } ), "some options were already set" );
1816+
PROGRAMOPTIONS_ASSERT( std::none_of( m_options.begin(), m_options.end(), []( options_t::value_type const& x ){ return x.second.was_set(); } ),
1817+
"some options were already set" );
18171818
assert( int_argc >= 0 );
18181819
const auto argc = static_cast< std::size_t >( int_argc );
18191820
if( argc == 0 )
@@ -1919,8 +1920,8 @@ namespace po {
19191920
}
19201921
}
19211922
}
1922-
for( auto&& i : m_options )
1923-
i.second.make_immutable();
1923+
for( auto&& opt : m_options )
1924+
opt.second.make_immutable();
19241925
return good;
19251926
}
19261927
bool parse( int argc, char** argv ) {

0 commit comments

Comments
 (0)