Skip to content

Commit 915b488

Browse files
author
Daniel Kroening
authored
Merge pull request #895 from NathanJPhillips/cleanup/break-irep-hash-dependency
Moved vector_hasht implementation into cpp file
2 parents eac93e3 + f34b705 commit 915b488

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

src/util/irep_hash_container.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Author: Daniel Kroening, [email protected]
88

99
#include "irep_hash_container.h"
1010
#include "irep.h"
11+
#include "irep_hash.h"
1112

1213
/*******************************************************************\
1314
@@ -41,6 +42,27 @@ size_t irep_hash_container_baset::number(const irept &irep)
4142

4243
/*******************************************************************\
4344
45+
Function: irep_hash_container_baset::vector_hasht::operator()
46+
47+
Inputs:
48+
49+
Outputs:
50+
51+
Purpose:
52+
53+
\*******************************************************************/
54+
55+
size_t irep_hash_container_baset::vector_hasht::operator()(
56+
const packedt &p) const
57+
{
58+
size_t result=p.size(); // seed
59+
for(auto elem : p)
60+
result=hash_combine(result, elem);
61+
return result;
62+
}
63+
64+
/*******************************************************************\
65+
4466
Function: irep_hash_container_baset::pack
4567
4668
Inputs:

src/util/irep_hash_container.h

+1-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected]
1212
#include <cstdlib> // for size_t
1313
#include <vector>
1414

15-
#include "irep_hash.h"
1615
#include "numbering.h"
1716

1817
class irept;
@@ -55,13 +54,7 @@ class irep_hash_container_baset
5554

5655
struct vector_hasht
5756
{
58-
size_t operator()(const packedt &p) const
59-
{
60-
size_t result=p.size(); // seed
61-
for(auto elem : p)
62-
result=hash_combine(result, elem);
63-
return result;
64-
}
57+
size_t operator()(const packedt &p) const;
6558
};
6659

6760
typedef hash_numbering<packedt, vector_hasht> numberingt;

0 commit comments

Comments
 (0)