mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
StorePath: Rewrite in C++
On nix-env -qa -f '<nixpkgs>', this reduces maximum RSS by 20970 KiB and runtime by 0.8%. This is mostly because we're not parsing the hash part as a hash anymore (just validating that it consists of base-32 characters). Also, replace storePathToHash() by StorePath::hashPart().
This commit is contained in:
parent
72e17290d4
commit
759947bf72
21 changed files with 110 additions and 111 deletions
|
@ -56,11 +56,11 @@ NarInfo::NarInfo(const Store & store, const std::string & s, const std::string &
|
|||
auto refs = tokenizeString<Strings>(value, " ");
|
||||
if (!references.empty()) corrupt();
|
||||
for (auto & r : refs)
|
||||
references.insert(StorePath::fromBaseName(r));
|
||||
references.insert(StorePath(r));
|
||||
}
|
||||
else if (name == "Deriver") {
|
||||
if (value != "unknown-deriver")
|
||||
deriver = StorePath::fromBaseName(value);
|
||||
deriver = StorePath(value);
|
||||
}
|
||||
else if (name == "System")
|
||||
system = value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue