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:
commit
4f50b1d178
20 changed files with 25 additions and 24 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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, "=");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue