apps: common: options: Avoid copying in range based for loop
The copy can trigger `-Wrange-loop-construct` and is not needed, so use a reference to avoid it. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
@@ -887,7 +887,7 @@ OptionsParser::Options OptionsParser::parse(int argc, char **argv)
|
||||
|
||||
shortOptions[ids++] = ':';
|
||||
|
||||
for (const auto [opt, option] : optionsMap_) {
|
||||
for (const auto &[opt, option] : optionsMap_) {
|
||||
if (option->hasShortOption()) {
|
||||
shortOptions[ids++] = opt;
|
||||
if (option->argument != ArgumentNone)
|
||||
|
||||
Reference in New Issue
Block a user