From ea83231da5284e189254466b9ce70b2f009a2b2f Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Mon, 25 Feb 2013 18:47:17 +0100 Subject: [PATCH] Fixing incorrect initialization of hash function --- DataStructures/XORFastHash.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DataStructures/XORFastHash.h b/DataStructures/XORFastHash.h index e90de23df..3f1b29460 100644 --- a/DataStructures/XORFastHash.h +++ b/DataStructures/XORFastHash.h @@ -46,10 +46,10 @@ class XORFastHash { //65k entries std::vector 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());