Skip to content

Commit da374a9

Browse files
author
litongxin
committed
fix reviewDog
1 parent ae99943 commit da374a9

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/storage/disk_table.cc

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,17 +1330,14 @@ int DiskTable::GetCount(uint32_t index, const std::string& pk, uint64_t& count)
13301330
break;
13311331
}
13321332
}
1333-
13341333
return 0;
13351334
}
13361335

1337-
uint32_t BloomFilter::hash(const char *str, uint32_t seed)
1338-
{
1336+
uint32_t BloomFilter::hash(const char* str, uint32_t seed) {
13391337
uint a = 63689;
13401338
uint hash = 0;
13411339

1342-
while (*str)
1343-
{
1340+
while (*str) {
13441341
hash = hash * a + (*str++);
13451342
a *= seed;
13461343
}
@@ -1362,20 +1359,15 @@ bool BloomFilter::getBit(uint32_t bit) {
13621359
return (bits_[bits_num]->load(std::memory_order_relaxed) >> bits_left) & 1;
13631360
}
13641361

1365-
void BloomFilter::Set(const char *str)
1366-
{
1367-
for (uint32_t i = 0; i < k_; ++i)
1368-
{
1362+
void BloomFilter::Set(const char* str) {
1363+
for (uint32_t i = 0; i < k_; ++i) {
13691364
uint32_t p = hash(str, base_[i]) % bitset_size_;
13701365
setBit(p);
13711366
}
1372-
13731367
}
13741368

1375-
bool BloomFilter::Valid(const char *str)
1376-
{
1377-
for (uint32_t i = 0; i < k_; ++i)
1378-
{
1369+
bool BloomFilter::Valid(const char* str) {
1370+
for (uint32_t i = 0; i < k_; ++i) {
13791371
uint32_t p = hash(str, base_[i]) % bitset_size_;
13801372
if (!getBit(p)) {
13811373
return false;

0 commit comments

Comments
 (0)