1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-12 03:51:04 +01:00

Fix JSON_IMPL macro to avoid extraneous copies

Should take the thing we're serializing by reference.
This commit is contained in:
John Ericson 2025-09-23 13:05:12 -04:00
parent d9de675357
commit af71a9dbd9
7 changed files with 17 additions and 17 deletions

View file

@ -356,7 +356,7 @@ DerivationOptions adl_serializer<DerivationOptions>::from_json(const json & json
};
}
void adl_serializer<DerivationOptions>::to_json(json & json, DerivationOptions o)
void adl_serializer<DerivationOptions>::to_json(json & json, const DerivationOptions & o)
{
json["outputChecks"] = std::visit(
overloaded{
@ -398,7 +398,7 @@ DerivationOptions::OutputChecks adl_serializer<DerivationOptions::OutputChecks>:
};
}
void adl_serializer<DerivationOptions::OutputChecks>::to_json(json & json, DerivationOptions::OutputChecks c)
void adl_serializer<DerivationOptions::OutputChecks>::to_json(json & json, const DerivationOptions::OutputChecks & c)
{
json["ignoreSelfRefs"] = c.ignoreSelfRefs;
json["allowedReferences"] = c.allowedReferences;