Use mkStringNoCopy for some more string literals

This commit is contained in:
Eelco Dolstra 2024-09-19 20:38:54 +02:00
parent ceb8833eb9
commit 561149b84f
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ static void prim_fromTOML(EvalState & state, const PosIdx pos, Value * * args, V
{
if (experimentalFeatureSettings.isEnabled(Xp::ParseTomlTimestamps)) {
auto attrs = state.buildBindings(2);
attrs.alloc("_type").mkString("timestamp");
attrs.alloc("_type").mkStringNoCopy("timestamp");
std::ostringstream s;
s << t;
attrs.alloc("value").mkString(s.str());

View File

@ -61,7 +61,7 @@ bool createUserEnv(EvalState & state, PackageInfos & elems,
auto attrs = state.buildBindings(7 + outputs.size());
attrs.alloc(state.sType).mkString("derivation");
attrs.alloc(state.sType).mkStringNoCopy("derivation");
attrs.alloc(state.sName).mkString(i.queryName());
auto system = i.querySystem();
if (!system.empty())