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

Merge pull request #10170 from johnrichardrinehart/jrinehart/2_18-faster-flake-lock-parsing

2.18 faster flake lock parsing
This commit is contained in:
tomberek 2024-03-07 00:11:54 -05:00 committed by GitHub
commit ec177b98f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,7 +89,7 @@ LockFile::LockFile(const nlohmann::json & json, const Path & path)
std::string inputKey = i.value(); std::string inputKey = i.value();
auto k = nodeMap.find(inputKey); auto k = nodeMap.find(inputKey);
if (k == nodeMap.end()) { if (k == nodeMap.end()) {
auto nodes = json["nodes"]; auto & nodes = json["nodes"];
auto jsonNode2 = nodes.find(inputKey); auto jsonNode2 = nodes.find(inputKey);
if (jsonNode2 == nodes.end()) if (jsonNode2 == nodes.end())
throw Error("lock file references missing node '%s'", inputKey); throw Error("lock file references missing node '%s'", inputKey);