aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libutil/hash.cc2
-rw-r--r--src/libutil/hash.hh4
2 files changed, 2 insertions, 4 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 448eb25f9..2087e3464 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -27,7 +27,7 @@ static size_t regularHashSize(HashType type) {
abort();
}
-void Hash::init()
+Hash::Hash(HashType type) : type(type)
{
hashSize = regularHashSize(type);
assert(hashSize <= maxHashSize);
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index 887952ce5..766009438 100644
--- a/src/libutil/hash.hh
+++ b/src/libutil/hash.hh
@@ -32,7 +32,7 @@ struct Hash
HashType type;
/* Create a zero-filled hash object. */
- Hash(HashType type) : type(type) { init(); };
+ Hash(HashType type);
/* Initialize the hash from a string representation, in the format
"[<type>:]<base16|base32|base64>" or "<type>-<base64>" (a
@@ -49,8 +49,6 @@ private:
// type must be provided, s must not include <type> prefix
Hash(std::string_view s, std::pair<HashType, bool> typeAndSRI);
- void init();
-
public:
/* Check whether a hash is set. */
operator bool () const { return (bool) type; }