Scoped parseInfos population so i can be reused

This commit is contained in:
Phil Nash 2017-09-26 16:06:48 -07:00
parent c1416d55cb
commit 5fe19f73e7

View File

@ -1145,9 +1145,12 @@ namespace detail {
assert( totalParsers < 512 ); assert( totalParsers < 512 );
// ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
ParserInfo parseInfos[512]; ParserInfo parseInfos[512];
size_t i = 0;
for( auto const& opt : m_options ) parseInfos[i++].parser = &opt; {
for( auto const& arg : m_args ) parseInfos[i++].parser = &arg; size_t i = 0;
for (auto const &opt : m_options) parseInfos[i++].parser = &opt;
for (auto const &arg : m_args) parseInfos[i++].parser = &arg;
}
m_exeName.set( exeName ); m_exeName.set( exeName );