diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-11-28 15:03:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 15:03:48 +0100 |
commit | dbf78a7adacc6cf8e977901cfb6bdabfd80f1ab5 (patch) | |
tree | b4501902568a9cae5cdd723a6d0526db5d98b4dc /src/libstore/parsed-derivations.cc | |
parent | cc308ee93d5b2027e1270295daa860fd73b71917 (diff) | |
parent | 09f00dd4d01aa1b6866978d162022133e521614f (diff) |
Merge pull request #7313 from yorickvP/nlohmann-everywhere
Replace src/libutil/json.cc with nlohmann
Diffstat (limited to 'src/libstore/parsed-derivations.cc')
-rw-r--r-- | src/libstore/parsed-derivations.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc index f2288a04e..59a30db10 100644 --- a/src/libstore/parsed-derivations.cc +++ b/src/libstore/parsed-derivations.cc @@ -2,7 +2,6 @@ #include <nlohmann/json.hpp> #include <regex> -#include "json.hh" namespace nix { @@ -144,16 +143,11 @@ std::optional<nlohmann::json> ParsedDerivation::prepareStructuredAttrs(Store & s auto e = json.find("exportReferencesGraph"); if (e != json.end() && e->is_object()) { for (auto i = e->begin(); i != e->end(); ++i) { - std::ostringstream str; - { - JSONPlaceholder jsonRoot(str, true); - StorePathSet storePaths; - for (auto & p : *i) - storePaths.insert(store.parseStorePath(p.get<std::string>())); - store.pathInfoToJSON(jsonRoot, - store.exportReferences(storePaths, inputPaths), false, true); - } - json[i.key()] = nlohmann::json::parse(str.str()); // urgh + StorePathSet storePaths; + for (auto & p : *i) + storePaths.insert(store.parseStorePath(p.get<std::string>())); + json[i.key()] = store.pathInfoToJSON( + store.exportReferences(storePaths, inputPaths), false, true); } } |