зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #17487 - Correct bloom hash bitpacking documentation (from MattWis:patch-1); r=emilio
The two 12 bit keys add to 24 bits, which leaves 8 bits free in each word. (And 8 * 3 = 24, to pack in the fourth hash.) <!-- Please describe your changes on the following line: --> I have never actually built servo, but I'm pretty sure that's not necessary for a 1 line comment-only change --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X ] These changes do not require tests because this is a comment only change <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 56cc39433f5dc902f80080060a4b6522383254e5 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : b71cd93bbc7e77fb8e3971f6ce7ff1e509d7d978
This commit is contained in:
Родитель
6474d54b07
Коммит
4ad350b305
|
@ -7,7 +7,7 @@
|
|||
use fnv::FnvHasher;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
// The top 12 bits of the 32-bit hash value are not used by the bloom filter.
|
||||
// The top 8 bits of the 32-bit hash value are not used by the bloom filter.
|
||||
// Consumers may rely on this to pack hashes more efficiently.
|
||||
pub const BLOOM_HASH_MASK: u32 = 0x00ffffff;
|
||||
const KEY_SIZE: usize = 12;
|
||||
|
|
Загрузка…
Ссылка в новой задаче