Skip to content

Commit

Permalink
cmdparser.hpp: Added ref to const auto range for.
Browse files Browse the repository at this point in the history
  • Loading branch information
tlanc007 committed Dec 22, 2020
1 parent f65e587 commit b528879
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmdparser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ namespace cli {
}

bool has_help() const {
for (const auto command : _commands) {
for (const auto& command : _commands) {
if (command->name == "h" && command->alternative == "--help") {
return true;
}
Expand Down Expand Up @@ -359,7 +359,7 @@ namespace cli {

bool doesArgumentExist(std::string name, std::string altName)
{
for (const auto argument : _arguments) {
for (const auto& argument : _arguments) {

if(argument == '-'+ name || argument == altName)
{
Expand Down

0 comments on commit b528879

Please sign in to comment.