Skip to content

Commit 895450b

Browse files
committed
Removing dead comments.
1 parent 8292bfe commit 895450b

File tree

4 files changed

+2
-147
lines changed

4 files changed

+2
-147
lines changed

src/xorfilter.h

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,7 @@ Status XorFilter<ItemType, FingerprintType, HashFamily>::AddAll(
145145
tmpc[b] = 0;
146146
}
147147
}
148-
/*
149-
int h0 = reduce((int) (hash), blockLength);
150-
int h1 = reduce((int) rotl64(hash, 21), blockLength) + blockLength;
151-
int h2 = reduce((int) rotl64(hash, 42), blockLength) + 2 * blockLength;
152-
t2vals[h0].t2count++;
153-
t2vals[h0].t2 ^= hash;
154-
t2vals[h1].t2count++;
155-
t2vals[h1].t2 ^= hash;
156-
t2vals[h2].t2count++;
157-
t2vals[h2].t2 ^= hash;
158-
*/
148+
159149
}
160150
for (int b = 0; b < blocks; b++) {
161151
applyBlock(tmp, b, tmpc[b], t2vals);
@@ -171,7 +161,6 @@ Status XorFilter<ItemType, FingerprintType, HashFamily>::AddAll(
171161
while (nextAloneCheck < arrayLength) {
172162
if (t2vals[nextAloneCheck].t2count == 1) {
173163
alone[alonePos++] = nextAloneCheck;
174-
// break;
175164
}
176165
nextAloneCheck++;
177166
}
@@ -206,38 +195,9 @@ Status XorFilter<ItemType, FingerprintType, HashFamily>::AddAll(
206195

207196
std::cout << "WARNING: hashIndex " << hashIndex << "\n";
208197
if (hashIndex >= 0) {
209-
// size_t outputlimit = 5; // we don't want to spam
210198
std::cout << (end - start) << " keys; arrayLength " << arrayLength
211199
<< " blockLength " << blockLength
212200
<< " reverseOrderPos " << reverseOrderPos << "\n";
213-
// int pos = 0;
214-
/* for (size_t i = 0; pos < 1000 && i < arrayLength; i++) {
215-
if (t2count[i] > 1) {
216-
if(outputlimit > 0) {
217-
std::cout << " count[" << i << "] = " << (int) t2count[i] << "\n";
218-
outputlimit --;
219-
}
220-
}
221-
}
222-
for(size_t i = start; i < end; i++) {
223-
uint64_t k = keys[i];
224-
uint64_t hash = (*hasher)(k);
225-
int h0 = reduce((int) (hash), blockLength);
226-
int h1 = reduce((int) rotl64(hash, 21), blockLength) + blockLength;
227-
int h2 = reduce((int) rotl64(hash, 42), blockLength) + 2 * blockLength;
228-
if (t2count[h0] > 1 || t2count[h1] > 1 || t2count[h2] > 1) {
229-
if(outputlimit > 0) {
230-
std::cout << " key " << k << " hash=" << hash << " h0=" << h0 << " h1=" << h1 << " h2=" << h2 << "\n";
231-
outputlimit --;
232-
}
233-
}
234-
}*/
235-
236-
// for(size_t i = start; i < end; i++) {
237-
// uint64_t k = keys[i];
238-
// std::cout << k << "\n";
239-
// }
240-
// std::cout << "end\n";
241201
}
242202

243203
hashIndex++;

src/xorfilter_2.h

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,7 @@ Status XorFilter2<ItemType, FingerprintType, FingerprintStorageType, HashFamily>
146146
tmpc[b] = 0;
147147
}
148148
}
149-
/*
150-
int h0 = reduce((int) (hash), blockLength);
151-
int h1 = reduce((int) rotl64(hash, 21), blockLength) + blockLength;
152-
int h2 = reduce((int) rotl64(hash, 42), blockLength) + 2 * blockLength;
153-
t2vals[h0].t2count++;
154-
t2vals[h0].t2 ^= hash;
155-
t2vals[h1].t2count++;
156-
t2vals[h1].t2 ^= hash;
157-
t2vals[h2].t2count++;
158-
t2vals[h2].t2 ^= hash;
159-
*/
149+
160150
}
161151
for (int b = 0; b < blocks; b++) {
162152
applyBlock(tmp, b, tmpc[b], t2vals);
@@ -172,7 +162,6 @@ Status XorFilter2<ItemType, FingerprintType, FingerprintStorageType, HashFamily>
172162
while (nextAloneCheck < arrayLength) {
173163
if (t2vals[nextAloneCheck].t2count == 1) {
174164
alone[alonePos++] = nextAloneCheck;
175-
// break;
176165
}
177166
nextAloneCheck++;
178167
}
@@ -207,38 +196,9 @@ Status XorFilter2<ItemType, FingerprintType, FingerprintStorageType, HashFamily>
207196

208197
std::cout << "WARNING: hashIndex " << hashIndex << "\n";
209198
if (hashIndex >= 0) {
210-
// size_t outputlimit = 5; // we don't want to spam
211199
std::cout << (end - start) << " keys; arrayLength " << arrayLength
212200
<< " blockLength " << blockLength
213201
<< " reverseOrderPos " << reverseOrderPos << "\n";
214-
// int pos = 0;
215-
/* for (size_t i = 0; pos < 1000 && i < arrayLength; i++) {
216-
if (t2count[i] > 1) {
217-
if(outputlimit > 0) {
218-
std::cout << " count[" << i << "] = " << (int) t2count[i] << "\n";
219-
outputlimit --;
220-
}
221-
}
222-
}
223-
for(size_t i = start; i < end; i++) {
224-
uint64_t k = keys[i];
225-
uint64_t hash = (*hasher)(k);
226-
int h0 = reduce((int) (hash), blockLength);
227-
int h1 = reduce((int) rotl64(hash, 21), blockLength) + blockLength;
228-
int h2 = reduce((int) rotl64(hash, 42), blockLength) + 2 * blockLength;
229-
if (t2count[h0] > 1 || t2count[h1] > 1 || t2count[h2] > 1) {
230-
if(outputlimit > 0) {
231-
std::cout << " key " << k << " hash=" << hash << " h0=" << h0 << " h1=" << h1 << " h2=" << h2 << "\n";
232-
outputlimit --;
233-
}
234-
}
235-
}*/
236-
237-
// for(size_t i = start; i < end; i++) {
238-
// uint64_t k = keys[i];
239-
// std::cout << k << "\n";
240-
// }
241-
// std::cout << "end\n";
242202
}
243203

244204
hashIndex++;

src/xorfilter_2n.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ Status XorFilter2n<ItemType, FingerprintType, FingerprintStorageType, HashFamily
195195
}
196196
}
197197

198-
// for(size_t i = start; i < end; i++) {
199-
// uint64_t k = keys[i];
200-
// std::cout << k << "\n";
201-
// }
202-
// std::cout << "end\n";
203198
}
204199

205200
hashIndex++;

src/xorfilter_plus.h

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,6 @@ class Rank9 {
6767
}
6868
}
6969
counts[numCounts] = c;
70-
/*
71-
// self-test (should be somewhere else)
72-
for(int i=0, j = 0; i<bitCount;i++) {
73-
uint64_t bit1 = sourceBits[i >> 6] & (1L << (i & 63));
74-
uint64_t bit2 = (bits[i >> 6] >> (i & 63)) & 1;
75-
if ((bit2 == 0 ? 0 : 1) != (bit1 == 0 ? 0 : 1)) {
76-
std::cout << "WARNING: get incorrect " << i << "\n";
77-
}
78-
if (rank(i) != j) {
79-
std::cout << "WARNING: rank incorrect " << i << "\n";
80-
}
81-
int rag = getAndPartialRank(i) + (remainingRank(i) << 1);
82-
if ((rag >> 1) != j) {
83-
std::cout << "WARNING: getAndPartialRank incorrect " << i << "\n";
84-
}
85-
if (bit2 != 0) {
86-
j++;
87-
}
88-
}
89-
*/
9070
}
9171

9272
~Rank9() {
@@ -259,17 +239,6 @@ Status XorFilterPlus<ItemType, FingerprintType, HashFamily>::AddAll(
259239
tmpc[b] = 0;
260240
}
261241
}
262-
/*
263-
int h0 = reduce((int) (hash), blockLength);
264-
int h1 = reduce((int) rotl64(hash, 21), blockLength) + blockLength;
265-
int h2 = reduce((int) rotl64(hash, 42), blockLength) + 2 * blockLength;
266-
t2vals[h0].t2count++;
267-
t2vals[h0].t2 ^= hash;
268-
t2vals[h1].t2count++;
269-
t2vals[h1].t2 ^= hash;
270-
t2vals[h2].t2count++;
271-
t2vals[h2].t2 ^= hash;
272-
*/
273242
}
274243
for (int b = 0; b < blocks; b++) {
275244
applyBlock(tmp, b, tmpc[b], t2vals);
@@ -335,38 +304,9 @@ Status XorFilterPlus<ItemType, FingerprintType, HashFamily>::AddAll(
335304

336305
std::cout << "WARNING: hashIndex " << hashIndex << "\n";
337306
if (hashIndex >= 0) {
338-
// size_t outputlimit = 5; // we don't want to spam
339307
std::cout << (end - start) << " keys; arrayLength " << arrayLength
340308
<< " blockLength " << blockLength
341309
<< " reverseOrderPos " << reverseOrderPos << "\n";
342-
// int pos = 0;
343-
/* for (size_t i = 0; pos < 1000 && i < arrayLength; i++) {
344-
if (t2count[i] > 1) {
345-
if(outputlimit > 0) {
346-
std::cout << " count[" << i << "] = " << (int) t2count[i] << "\n";
347-
outputlimit --;
348-
}
349-
}
350-
}
351-
for(size_t i = start; i < end; i++) {
352-
uint64_t k = keys[i];
353-
uint64_t hash = (*hasher)(k);
354-
int h0 = reduce((int) (hash), blockLength);
355-
int h1 = reduce((int) rotl64(hash, 21), blockLength) + blockLength;
356-
int h2 = reduce((int) rotl64(hash, 42), blockLength) + 2 * blockLength;
357-
if (t2count[h0] > 1 || t2count[h1] > 1 || t2count[h2] > 1) {
358-
if(outputlimit > 0) {
359-
std::cout << " key " << k << " hash=" << hash << " h0=" << h0 << " h1=" << h1 << " h2=" << h2 << "\n";
360-
outputlimit --;
361-
}
362-
}
363-
}*/
364-
365-
// for(size_t i = start; i < end; i++) {
366-
// uint64_t k = keys[i];
367-
// std::cout << k << "\n";
368-
// }
369-
// std::cout << "end\n";
370310
}
371311

372312
hashIndex++;

0 commit comments

Comments
 (0)