From 2d6d9a28ebb17b1ba1fe0dc4d56b6aa311f94d39 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 15 Feb 2022 15:08:06 +0100 Subject: [PATCH] addToStoreFromDump(): Take std::string_view --- src/libstore/binary-cache-store.cc | 2 +- src/libstore/binary-cache-store.hh | 4 ++-- src/libstore/build/local-derivation-goal.cc | 2 +- src/libstore/local-store.cc | 2 +- src/libstore/local-store.hh | 2 +- src/libstore/remote-store.cc | 4 ++-- src/libstore/remote-store.hh | 4 ++-- src/libstore/store-api.hh | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 6e4458f7a..b3fd991a1 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -307,7 +307,7 @@ void BinaryCacheStore::addToStore(const ValidPathInfo & info, Source & narSource }}); } -StorePath BinaryCacheStore::addToStoreFromDump(Source & dump, const string & name, +StorePath BinaryCacheStore::addToStoreFromDump(Source & dump, std::string_view name, FileIngestionMethod method, HashType hashAlgo, RepairFlag repair, const StorePathSet & references) { if (method != FileIngestionMethod::Recursive || hashAlgo != htSHA256) diff --git a/src/libstore/binary-cache-store.hh b/src/libstore/binary-cache-store.hh index 7599230d9..5b5d064f3 100644 --- a/src/libstore/binary-cache-store.hh +++ b/src/libstore/binary-cache-store.hh @@ -98,8 +98,8 @@ public: void addToStore(const ValidPathInfo & info, Source & narSource, RepairFlag repair, CheckSigsFlag checkSigs) override; - StorePath addToStoreFromDump(Source & dump, const string & name, - FileIngestionMethod method, HashType hashAlgo, RepairFlag repair, const StorePathSet & references ) override; + StorePath addToStoreFromDump(Source & dump, std::string_view name, + FileIngestionMethod method, HashType hashAlgo, RepairFlag repair, const StorePathSet & references) override; StorePath addToStore(const string & name, const Path & srcPath, FileIngestionMethod method, HashType hashAlgo, diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index b76ad702b..8861d2c7b 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -1208,7 +1208,7 @@ struct RestrictedStore : public virtual RestrictedStoreConfig, public virtual Lo return path; } - StorePath addToStoreFromDump(Source & dump, const string & name, + StorePath addToStoreFromDump(Source & dump, std::string_view name, FileIngestionMethod method = FileIngestionMethod::Recursive, HashType hashAlgo = htSHA256, RepairFlag repair = NoRepair, const StorePathSet & references = StorePathSet()) override { diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 284e385e6..1a02b916a 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1318,7 +1318,7 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source, } -StorePath LocalStore::addToStoreFromDump(Source & source0, const string & name, +StorePath LocalStore::addToStoreFromDump(Source & source0, std::string_view name, FileIngestionMethod method, HashType hashAlgo, RepairFlag repair, const StorePathSet & references) { /* For computing the store path. */ diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 8cf9c68b3..46aed9bcb 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -144,7 +144,7 @@ public: void addToStore(const ValidPathInfo & info, Source & source, RepairFlag repair, CheckSigsFlag checkSigs) override; - StorePath addToStoreFromDump(Source & dump, const string & name, + StorePath addToStoreFromDump(Source & dump, std::string_view name, FileIngestionMethod method, HashType hashAlgo, RepairFlag repair, const StorePathSet & references) override; StorePath addTextToStore(const string & name, const string & s, diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 573becfbd..c6f083dea 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -500,7 +500,7 @@ std::optional RemoteStore::queryPathFromHashPart(const std::string & ref RemoteStore::addCAToStore( Source & dump, - const string & name, + std::string_view name, ContentAddressMethod caMethod, const StorePathSet & references, RepairFlag repair) @@ -582,7 +582,7 @@ ref RemoteStore::addCAToStore( } -StorePath RemoteStore::addToStoreFromDump(Source & dump, const string & name, +StorePath RemoteStore::addToStoreFromDump(Source & dump, std::string_view name, FileIngestionMethod method, HashType hashType, RepairFlag repair, const StorePathSet & references) { return addCAToStore(dump, name, FixedOutputHashMethod{ .fileIngestionMethod = method, .hashType = hashType }, references, repair)->path; diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh index b91d25fa9..55cfd5cc6 100644 --- a/src/libstore/remote-store.hh +++ b/src/libstore/remote-store.hh @@ -66,13 +66,13 @@ public: /* Add a content-addressable store path. `dump` will be drained. */ ref addCAToStore( Source & dump, - const string & name, + std::string_view name, ContentAddressMethod caMethod, const StorePathSet & references, RepairFlag repair); /* Add a content-addressable store path. Does not support references. `dump` will be drained. */ - StorePath addToStoreFromDump(Source & dump, const string & name, + StorePath addToStoreFromDump(Source & dump, std::string_view name, FileIngestionMethod method = FileIngestionMethod::Recursive, HashType hashAlgo = htSHA256, RepairFlag repair = NoRepair, const StorePathSet & references = StorePathSet()) override; void addToStore(const ValidPathInfo & info, Source & nar, diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 4068f8f35..90d2e93ed 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -499,7 +499,7 @@ public: false). `dump` may be drained */ // FIXME: remove? - virtual StorePath addToStoreFromDump(Source & dump, const string & name, + virtual StorePath addToStoreFromDump(Source & dump, std::string_view name, FileIngestionMethod method = FileIngestionMethod::Recursive, HashType hashAlgo = htSHA256, RepairFlag repair = NoRepair, const StorePathSet & references = StorePathSet()) { unsupported("addToStoreFromDump"); }