Fixing incorrect initialization of hash function
This commit is contained in:
parent
c4693602ef
commit
ea83231da5
@ -46,10 +46,10 @@ class XORFastHash { //65k entries
|
||||
std::vector<unsigned short> table2;
|
||||
public:
|
||||
XORFastHash() {
|
||||
table1.resize(2 << 16);
|
||||
table2.resize(2 << 16);
|
||||
for(unsigned i = 0; i < (2 << 16); ++i) {
|
||||
table1[i] = i; table2[i];
|
||||
table1.resize(1 << 16);
|
||||
table2.resize(1 << 16);
|
||||
for(unsigned i = 0; i < (1 << 16); ++i) {
|
||||
table1[i] = i; table2[i] = i;
|
||||
}
|
||||
std::random_shuffle(table1.begin(), table1.end());
|
||||
std::random_shuffle(table2.begin(), table2.end());
|
||||
@ -75,8 +75,8 @@ public:
|
||||
table3.resize(1 << 8);
|
||||
table4.resize(1 << 8);
|
||||
for(unsigned i = 0; i < (1 << 8); ++i) {
|
||||
table1[i] = i; table2[i];
|
||||
table3[i] = i; table4[i];
|
||||
table1[i] = i; table2[i] = i;
|
||||
table3[i] = i; table4[i] = i;
|
||||
}
|
||||
std::random_shuffle(table1.begin(), table1.end());
|
||||
std::random_shuffle(table2.begin(), table2.end());
|
||||
|
Loading…
Reference in New Issue
Block a user