mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
fix(treewide): remove unnecessary copying in range for loops
This gets rid of unnecessary copies in range-based-for loops and local variables, when they are used solely as `const &`. Also added a fixme comment about a suspicious move out of const, which might not be intended.
This commit is contained in:
parent
4fc5295328
commit
fafaec5ac3
20 changed files with 25 additions and 24 deletions
|
|
@ -222,7 +222,7 @@ static void opPrintFixedPath(Strings opFlags, Strings opArgs)
|
|||
{
|
||||
auto method = FileIngestionMethod::Flat;
|
||||
|
||||
for (auto i : opFlags)
|
||||
for (const auto & i : opFlags)
|
||||
if (i == "--recursive") method = FileIngestionMethod::NixArchive;
|
||||
else throw UsageError("unknown flag '%1%'", i);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue