about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-07-26T19·25+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-07-26T19·25+0200
commitee22a91ab847f63a22466f3bf63e33ca29da9cfe (patch)
tree6808d04aeb5b66411014f252c1ee3c1f1e35d0d9 /src/libstore/store-api.cc
parent06bbfb6004942bfcddd930e746ee7a2bfe5c3872 (diff)
makeFixedOutputPath(): Drop superfluous HashType argument
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc11
1 files changed, 5 insertions, 6 deletions
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<Path, Hash> 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<Path, Hash>(dstPath, h);
 }