1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

SymbolStr: Remove std::string conversion

This refactoring allows the symbol table to be stored as something
other than std::strings.
This commit is contained in:
Eelco Dolstra 2024-06-06 16:33:41 +02:00
parent 0363dbf2b9
commit 61080554ab
15 changed files with 37 additions and 37 deletions

View file

@ -98,7 +98,7 @@ static std::map<FlakeId, FlakeInput> parseFlakeInputs(
const std::optional<Path> & baseDir, InputPath lockRootPath);
static FlakeInput parseFlakeInput(EvalState & state,
const std::string & inputName, Value * value, const PosIdx pos,
std::string_view inputName, Value * value, const PosIdx pos,
const std::optional<Path> & baseDir, InputPath lockRootPath)
{
expectType(state, nAttrs, *value, pos);
@ -178,7 +178,7 @@ static FlakeInput parseFlakeInput(EvalState & state,
}
if (!input.follows && !input.ref)
input.ref = FlakeRef::fromAttrs({{"type", "indirect"}, {"id", inputName}});
input.ref = FlakeRef::fromAttrs({{"type", "indirect"}, {"id", std::string(inputName)}});
return input;
}
@ -244,7 +244,7 @@ static Flake readFlake(
for (auto & formal : outputs->value->payload.lambda.fun->formals->formals) {
if (formal.name != state.sSelf)
flake.inputs.emplace(state.symbols[formal.name], FlakeInput {
.ref = parseFlakeRef(state.symbols[formal.name])
.ref = parseFlakeRef(std::string(state.symbols[formal.name]))
});
}
}