diff options
Diffstat (limited to 'src/lib/hash/par_hash/par_hash.cpp')
-rw-r--r-- | src/lib/hash/par_hash/par_hash.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/hash/par_hash/par_hash.cpp b/src/lib/hash/par_hash/par_hash.cpp index 2a1ef7c9c..af43d6d97 100644 --- a/src/lib/hash/par_hash/par_hash.cpp +++ b/src/lib/hash/par_hash/par_hash.cpp @@ -56,6 +56,18 @@ HashFunction* Parallel::clone() const return new Parallel(hash_copies); } +std::unique_ptr<HashFunction> Parallel::copy_state() const + { + std::vector<std::unique_ptr<HashFunction>> hash_clones; + + for(const std::unique_ptr<HashFunction>& hash : m_hashes) + { + hash_clones.push_back(hash->copy_state()); + } + + return std::unique_ptr<HashFunction>(new Parallel(hash_clones)); + } + void Parallel::clear() { for(auto&& hash : m_hashes) |