Skip to content

Commit

Permalink
Minor improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinH committed Mar 31, 2024
1 parent 152d4ed commit 2e3d01b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
14 changes: 7 additions & 7 deletions include/tao/config/internal/phase2_asterisks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ namespace tao::config::internal
case entry_kind::STRING:
case entry_kind::BINARY:
case entry_kind::SIGNED:
case entry_kind::DOUBLE:
case entry_kind::UNSIGNED:
case entry_kind::DOUBLE:
++i;
return;
case entry_kind::ARRAY:
Expand All @@ -75,7 +75,7 @@ namespace tao::config::internal
++i;
return;
case entry_kind::ASTERISK:
process_concat_entry( c, i );
process_asterisk( c, i );
return;
case entry_kind::REFERENCE:
++i;
Expand All @@ -84,7 +84,7 @@ namespace tao::config::internal
throw std::logic_error( "code should be unreachable" ); // LCOV_EXCL_LINE
}

void process_concat_entry( concat& c, std::list< entry >::iterator& i )
void process_asterisk( concat& c, std::list< entry >::iterator& i )
{
const concat star = std::move( i->get_asterisk() );

Expand All @@ -104,7 +104,7 @@ namespace tao::config::internal
if( !j->get_array().function.empty() ) {
throw pegtl::parse_error( "please do not use an asterisk inside of a function", j->get_array().position );
}
process_array_concat_entry( j->get_array(), star );
process_array_and_asterisk( j->get_array(), star );
continue;
case entry_kind::OBJECT:
for( const auto& p : j->get_object().object ) {
Expand All @@ -130,7 +130,7 @@ namespace tao::config::internal
if( !j->get_array().function.empty() ) {
throw pegtl::parse_error( "please do not use an asterisk inside of a function", j->get_array().position );
}
process_concat_entry_array( star, j->get_array() );
process_asterisk_and_array( star, j->get_array() );
continue;
case entry_kind::OBJECT:
for( const auto& p : j->get_object().object ) {
Expand All @@ -157,7 +157,7 @@ namespace tao::config::internal
++i;
}

void process_concat_entry_array( const concat& s, array& a )
void process_asterisk_and_array( const concat& s, array& a )
{
for( concat& c : a.array ) {
if( c.remove ) {
Expand All @@ -169,7 +169,7 @@ namespace tao::config::internal
}
}

void process_array_concat_entry( array& a, const concat& s )
void process_array_and_asterisk( array& a, const concat& s )
{
for( concat& c : a.array ) {
if( s.remove ) {
Expand Down
3 changes: 1 addition & 2 deletions include/tao/config/internal/phase2_everything.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace tao::config::internal
inline void phase2_everything( state& st, const function_map& fm )
{
while( phase2_iteration( st, fm ) ) {
// This loop could do with some major optimisations, though they would only be worth it
// if somebody reads some really large config files (or reads one 10^7 times per second).
// This loop could do with some major optimisations; might or might not be worth the effort.
}
}

Expand Down
1 change: 0 additions & 1 deletion include/tao/config/internal/phase2_references.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ namespace tao::config::internal
assert( d->concat.size() == 1 );

e = d->concat.front();
// TODO: Call phase2_additions( c ) to get things done quicker?
++m_changes;
}
}
Expand Down
4 changes: 2 additions & 2 deletions include/tao/config/internal/reference2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ namespace tao::config::internal
reference2() = default;

reference2( reference2&& ) = default;
reference2& operator=( reference2&& ) = default;
reference2( const reference2& ) = default;

~reference2() = default;

reference2( const reference2& ) = default;
reference2& operator=( reference2&& ) = default;
reference2& operator=( const reference2& ) = default;

explicit reference2( const std::string& s )
Expand Down

0 comments on commit 2e3d01b

Please sign in to comment.