1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 00:51:47 +02:00

Merge pull request #11944 from xokdvium/dev/remove-unnecessary-copies

fix(treewide): remove unnecessary copying in range for loops
This commit is contained in:
Eelco Dolstra 2024-11-26 12:56:51 +01:00 committed by GitHub
commit 4f50b1d178
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 25 additions and 24 deletions

View file

@ -348,7 +348,7 @@ void RootArgs::parseCmdline(const Strings & _cmdline, bool allowShebang)
/* Now that all the other args are processed, run the deferred completions.
*/
for (auto d : deferredCompletions)
for (const auto & d : deferredCompletions)
d.completer(*completions, d.n, d.prefix);
}

View file

@ -77,7 +77,7 @@ std::map<std::string, std::string> decodeQuery(const std::string & query)
{
std::map<std::string, std::string> result;
for (auto s : tokenizeString<Strings>(query, "&")) {
for (const auto & s : tokenizeString<Strings>(query, "&")) {
auto e = s.find('=');
if (e == std::string::npos) {
warn("dubious URI query '%s' is missing equal sign '%s', ignoring", s, "=");