From ee22a91ab847f63a22466f3bf63e33ca29da9cfe Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 26 Jul 2016 21:25:52 +0200 Subject: makeFixedOutputPath(): Drop superfluous HashType argument --- src/libstore/store-api.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libstore/store-api.cc') diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 2a062b9b2cd3..af002dcc8c33 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -191,13 +191,13 @@ Path Store::makeOutputPath(const string & id, Path Store::makeFixedOutputPath(bool recursive, - HashType hashAlgo, Hash hash, string name) const + const Hash & hash, const string & name) const { - return hashAlgo == htSHA256 && recursive + return hash.type == htSHA256 && recursive ? makeStorePath("source", hash, name) : makeStorePath("output:out", hashString(htSHA256, "fixed:out:" + (recursive ? (string) "r:" : "") + - printHashType(hashAlgo) + ":" + printHash(hash) + ":"), + printHashType(hash.type) + ":" + printHash(hash) + ":"), name); } @@ -205,10 +205,9 @@ Path Store::makeFixedOutputPath(bool recursive, std::pair Store::computeStorePathForPath(const Path & srcPath, bool recursive, HashType hashAlgo, PathFilter & filter) const { - HashType ht(hashAlgo); - Hash h = recursive ? hashPath(ht, srcPath, filter).first : hashFile(ht, srcPath); + Hash h = recursive ? hashPath(hashAlgo, srcPath, filter).first : hashFile(hashAlgo, srcPath); string name = baseNameOf(srcPath); - Path dstPath = makeFixedOutputPath(recursive, hashAlgo, h, name); + Path dstPath = makeFixedOutputPath(recursive, h, name); return std::pair(dstPath, h); } -- cgit 1.4.1