Skip to content

Commit

Permalink
Merge pull request #1193 from gruenich/feature/range-loop-reference
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 authored Feb 10, 2024
2 parents c9651d9 + 83a5bfb commit 4db866d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions elf/cmdline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
ctx.arg.apply_dynamic_relocs = false;

auto read_arg = [&](std::string name) {
for (std::string opt : add_dashes(name)) {
for (const std::string &opt : add_dashes(name)) {
if (args[0] == opt) {
if (args.size() == 1)
Fatal(ctx) << "option -" << name << ": argument missing";
Expand All @@ -457,7 +457,7 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
};

auto read_eq = [&](std::string name) {
for (std::string opt : add_dashes(name)) {
for (const std::string &opt : add_dashes(name)) {
if (args[0].starts_with(opt + "=")) {
arg = args[0].substr(opt.size() + 1);
args = args.subspan(1);
Expand All @@ -468,7 +468,7 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
};

auto read_flag = [&](std::string name) {
for (std::string opt : add_dashes(name)) {
for (const std::string &opt : add_dashes(name)) {
if (args[0] == opt) {
args = args.subspan(1);
return true;
Expand Down

0 comments on commit 4db866d

Please sign in to comment.