mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Pass more values by reference
Rather than copying them around everywhere Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
This commit is contained in:
parent
dcabb46124
commit
c13d7d0b97
3 changed files with 6 additions and 6 deletions
|
@ -255,8 +255,8 @@ StorePaths Store::topoSortPaths(const StorePathSet & paths)
|
|||
}
|
||||
|
||||
std::map<DrvOutput, StorePath> drvOutputReferences(
|
||||
const std::set<Realisation> inputRealisations,
|
||||
const StorePathSet pathReferences)
|
||||
const std::set<Realisation> & inputRealisations,
|
||||
const StorePathSet & pathReferences)
|
||||
{
|
||||
std::map<DrvOutput, StorePath> res;
|
||||
|
||||
|
|
|
@ -22,14 +22,14 @@ std::string DrvOutput::to_string() const {
|
|||
return strHash() + "!" + outputName;
|
||||
}
|
||||
|
||||
std::set<Realisation> Realisation::closure(Store & store, std::set<Realisation> startOutputs)
|
||||
std::set<Realisation> Realisation::closure(Store & store, const std::set<Realisation> & startOutputs)
|
||||
{
|
||||
std::set<Realisation> res;
|
||||
Realisation::closure(store, startOutputs, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
void Realisation::closure(Store & store, std::set<Realisation> startOutputs, std::set<Realisation> & res)
|
||||
void Realisation::closure(Store & store, const std::set<Realisation> & startOutputs, std::set<Realisation> & res)
|
||||
{
|
||||
auto getDeps = [&](const Realisation& current) -> std::set<Realisation> {
|
||||
std::set<Realisation> res;
|
||||
|
|
|
@ -44,8 +44,8 @@ struct Realisation {
|
|||
bool checkSignature(const PublicKeys & publicKeys, const std::string & sig) const;
|
||||
size_t checkSignatures(const PublicKeys & publicKeys) const;
|
||||
|
||||
static std::set<Realisation> closure(Store &, std::set<Realisation>);
|
||||
static void closure(Store &, std::set<Realisation>, std::set<Realisation>& res);
|
||||
static std::set<Realisation> closure(Store &, const std::set<Realisation> &);
|
||||
static void closure(Store &, const std::set<Realisation> &, std::set<Realisation>& res);
|
||||
|
||||
StorePath getPath() const { return outPath; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue