Skip to content

Commit 8c7c8b3

Browse files
committed
Use 1.23*size + 32
1 parent 7c672d5 commit 8c7c8b3

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/xorfilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class XorFilter {
5858
explicit XorFilter(const size_t size) {
5959
hasher = new HashFamily();
6060
this->size = size;
61-
this->arrayLength = 3 + 1.23 * size;
61+
this->arrayLength = 32 + 1.23 * size;
6262
this->blockLength = arrayLength / 3;
6363
fingerprints = new FingerprintType[arrayLength]();
6464
std::fill_n(fingerprints, arrayLength, 0);

src/xorfilter_2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class XorFilter2 {
7373
explicit XorFilter2(const size_t size) {
7474
hasher = new HashFamily();
7575
this->size = size;
76-
this->arrayLength = 3 + 1.23 * size;
76+
this->arrayLength = 32 + 1.23 * size;
7777
this->blockLength = arrayLength / 3;
7878
fingerprints = new FingerprintStorageType(arrayLength);
7979
}

src/xorfilter_2n.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class XorFilter2n {
6868
explicit XorFilter2n(const size_t size) {
6969
hasher = new HashFamily();
7070
this->size = size;
71-
this->arrayLength = 3 + 1.23 * size;
71+
this->arrayLength = 32 + 1.23 * size;
7272
this->blockLength = 1;
7373
while (this->blockLength < arrayLength / 3) {
7474
this->blockLength *= 2;

src/xorfilter_plus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class XorFilterPlus {
201201
explicit XorFilterPlus(const size_t size) {
202202
hasher = new HashFamily();
203203
this->size = size;
204-
this->arrayLength = 3 + 1.23 * size;
204+
this->arrayLength = 32 + 1.23 * size;
205205
this->blockLength = arrayLength / 3;
206206
}
207207

0 commit comments

Comments
 (0)