mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +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
|
|
@ -4383,7 +4383,7 @@ void prim_split(EvalState & state, const PosIdx pos, Value * * args, Value & v)
|
|||
|
||||
for (auto i = begin; i != end; ++i) {
|
||||
assert(idx <= 2 * len + 1 - 3);
|
||||
auto match = *i;
|
||||
const auto & match = *i;
|
||||
|
||||
// Add a string for non-matched characters.
|
||||
list[idx++] = mkString(state, match.prefix());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue