mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02: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
|
@ -454,7 +454,7 @@ struct S3BinaryCacheStoreImpl : virtual S3BinaryCacheStoreConfig, public virtual
|
|||
debug("got %d keys, next marker '%s'",
|
||||
contents.size(), res.GetNextMarker());
|
||||
|
||||
for (auto object : contents) {
|
||||
for (const auto & object : contents) {
|
||||
auto & key = object.GetKey();
|
||||
if (key.size() != 40 || !hasSuffix(key, ".narinfo")) continue;
|
||||
paths.insert(parseStorePath(storeDir + "/" + key.substr(0, key.size() - 8) + "-" + MissingName));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue