Skip to content

Commit 850d4d6

Browse files
author
Fytch
committed
rename neg to neg_exp in str2flt; improves readability and stops a warning about shadowing a local variable
1 parent ea19c71 commit 850d4d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ProgramOptions.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,15 +638,15 @@ namespace po {
638638
if( !valid )
639639
return error_code::conversion_error;
640640
if( expect( first, last, 'e' ) ) {
641-
const bool neg = expect( first, last, '-' );
642-
if( !neg )
641+
const bool neg_exp = expect( first, last, '-' );
642+
if( !neg_exp )
643643
expect( first, last, '+' );
644644
if( first == last || !is_digit( *first ) )
645645
return error_code::conversion_error;
646646
int exp{};
647647
for( int d{}; first != last && ( d = get_digit( *first ) ) >= 0; ++first )
648648
exp = 10 * exp + static_cast< int >( d );
649-
if( neg )
649+
if( neg_exp )
650650
exp = -exp;
651651
result *= std::pow( T{ 10 }, exp );
652652
}

0 commit comments

Comments
 (0)