Skip to content

Commit 6f63b80

Browse files
authored
Merge pull request #586 from evoskuil/master
Compress sparsely-populated two dimensional constant array.
2 parents ebfc852 + ba81e60 commit 6f63b80

6 files changed

Lines changed: 202 additions & 199 deletions

File tree

include/bitcoin/database/impl/primitives/sieve.ipp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ constexpr bool CLASS::screened(sieve_t fingerprint) const NOEXCEPT
9090
// Compare masked fingerprint to masked sieve, for all masks of the screen.
9191
for (sieve_t segment{}; segment <= row; ++segment)
9292
{
93-
const auto mask = matrix_[row][segment];
93+
const auto mask = masks(row, segment);
9494
if (bit_and(fingerprint, mask) == bit_and(sieve_, mask))
9595
return true;
9696
}
@@ -133,7 +133,7 @@ constexpr bool CLASS::screen(sieve_t fingerprint) NOEXCEPT
133133
}
134134

135135
// Both indexes are screen selector, as each new screen adds one mask.
136-
const auto mask = matrix_[row][row];
136+
const auto mask = masks(row, row);
137137

138138
// Merge incremented selector, current sieve, and new fingerprint.
139139
sieve_ = bit_or

0 commit comments

Comments
 (0)