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

return string_views from forceString*

once a string has been forced we already have dynamic storage allocated for it,
so we can easily reuse that storage instead of copying.
This commit is contained in:
pennae 2022-01-21 14:44:00 +01:00
parent 0d7fae6a57
commit 41d70a2fc8
19 changed files with 94 additions and 87 deletions

View file

@ -699,10 +699,10 @@ void writeDerivation(Sink & out, const Store & store, const BasicDerivation & dr
}
std::string hashPlaceholder(const std::string & outputName)
std::string hashPlaceholder(const std::string_view outputName)
{
// FIXME: memoize?
return "/" + hashString(htSHA256, "nix-output:" + outputName).to_string(Base32, false);
return "/" + hashString(htSHA256, concatStrings("nix-output:", outputName)).to_string(Base32, false);
}
std::string downstreamPlaceholder(const Store & store, const StorePath & drvPath, std::string_view outputName)