chore: ArgParse, use auto where possible
This commit is contained in:
parent
af70ff98b7
commit
7cc108d87c
1 changed files with 2 additions and 2 deletions
|
|
@ -337,7 +337,7 @@ const char **ArgParser::getArgv(std::vector<std::string> &argsArray)
|
||||||
// we use the c string pointers from argsArray and assign
|
// we use the c string pointers from argsArray and assign
|
||||||
// them to the inner array. So caller only need to use
|
// them to the inner array. So caller only need to use
|
||||||
// delete[] to delete the outer array
|
// delete[] to delete the outer array
|
||||||
const char **argv = new const char *[argc];
|
const auto **argv = new const char *[argc];
|
||||||
|
|
||||||
for (size_t i = 0; i < argc; i++) {
|
for (size_t i = 0; i < argc; i++) {
|
||||||
argv[i] = argsArray[i].c_str();
|
argv[i] = argsArray[i].c_str();
|
||||||
|
|
@ -351,7 +351,7 @@ ArgParser::assembleCommand(std::vector<std::string> &argsArray, std::string igno
|
||||||
{
|
{
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|
||||||
for (std::vector<std::string>::iterator it = argsArray.begin(); it != argsArray.end(); ++it) {
|
for (auto it = argsArray.begin(); it != argsArray.end(); ++it) {
|
||||||
if (it->compare(ignoreArg) == 0) {
|
if (it->compare(ignoreArg) == 0) {
|
||||||
it = it + parametersRequired;
|
it = it + parametersRequired;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue