Skip to content

Commit

Permalink
Merge pull request #23 from tlanc007/add_const_ref_to_range_for
Browse files Browse the repository at this point in the history
cmdparser.hpp: Added ref to const auto range for.
  • Loading branch information
FlorianRappl committed Dec 22, 2020
2 parents f65e587 + b528879 commit 9b35fdb
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 9b35fdb

Please sign in to comment.