diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-01-06 12:26:15 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-01-06 12:26:15 -0500 |
commit | 9cfa78e58a92b4bf034867bc1296a200bdc3f12a (patch) | |
tree | 3ab132a2ba938bed177251aa80a316ab1e0aa3b0 | |
parent | 6a168254ce068c067259c913ee7d6ee2e0d1dc7e (diff) |
Optimize `ValidPathInfo` construction a bit better
-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 4b89465e7..cd48d616b 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1340,13 +1340,13 @@ ValidPathInfo::ValidPathInfo( , narHash(narHash) { std::visit(overloaded { - [this](const TextInfo & ti) { - this->references = ti.references; - this->ca = TextHash { std::move(ti) }; + [this](TextInfo && ti) { + this->references = std::move(ti.references); + this->ca = std::move((TextHash &&) ti); }, - [this](const FixedOutputInfo & foi) { - *(static_cast<PathReferences<StorePath> *>(this)) = foi.references; - this->ca = FixedOutputHash { (FixedOutputHash) std::move(foi) }; + [this](FixedOutputInfo && foi) { + *(static_cast<PathReferences<StorePath> *>(this)) = std::move(foi.references); + this->ca = std::move((FixedOutputHash &&) foi); }, }, std::move(info.info)); } |