diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-10-01 17:12:54 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-10-01 17:12:54 +0000 |
commit | 13b6b645897fd2edaa0f09fa48d6fe8dd6287b55 (patch) | |
tree | 0c6fc18fa246115402c9fd0030029d9a4ebde82f /src/libstore/store-api.cc | |
parent | f4f3203aa7c2fc9225a8ae220db25593066fb397 (diff) | |
parent | 4f496150eb4e0012914c11f0a3ff4df2412b1d09 (diff) |
Merge remote-tracking branch 'upstream/master' into path-info
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 3cb3356f3..a57eab3e6 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -208,10 +208,10 @@ StorePath Store::makeFixedOutputPathFromCA(const StorePathDescriptor & desc) con { // New template return std::visit(overloaded { - [&](TextInfo ti) { + [&](const TextInfo & ti) { return makeTextPath(desc.name, ti); }, - [&](FixedOutputInfo foi) { + [&](const FixedOutputInfo & foi) { return makeFixedOutputPath(desc.name, foi); } }, desc.info); @@ -1150,13 +1150,13 @@ std::optional<StorePathDescriptor> ValidPathInfo::fullStorePathDescriptorOpt() c return StorePathDescriptor { .name = std::string { path.name() }, .info = std::visit(overloaded { - [&](TextHash th) { + [&](const TextHash & th) { TextInfo info { th }; assert(!hasSelfReference); info.references = references; return ContentAddressWithReferences { info }; }, - [&](FixedOutputHash foh) { + [&](const FixedOutputHash & foh) { FixedOutputInfo info { foh }; info.references = static_cast<PathReferences<StorePath>>(*this); return ContentAddressWithReferences { info }; @@ -1218,11 +1218,11 @@ ValidPathInfo::ValidPathInfo( , narHash(narHash) { std::visit(overloaded { - [this](TextInfo ti) { + [this](const TextInfo & ti) { this->references = ti.references; this->ca = TextHash { std::move(ti) }; }, - [this](FixedOutputInfo foi) { + [this](const FixedOutputInfo & foi) { *(static_cast<PathReferences<StorePath> *>(this)) = foi.references; this->ca = FixedOutputHash { (FixedOutputHash) std::move(foi) }; }, |