Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up #265 #278

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Bumped the minimum supported Rust version (MSRV) to 1.65 (Nov 3, 2022).

- Removed `num_cpus` crate from the dependency. ([#277][gh-pull-0277])

### Changed

- Refactored internal methods of the concurrent hash table to reduce compile times.
([#265][gh-pull-0265], by [@Swatinem][gh-Swatinem])


## Version 0.11.1

### Fixed
Expand All @@ -21,6 +27,7 @@ Bumped the minimum supported Rust version (MSRV) to 1.65 (Nov 3, 2022).
- Added some example programs to the `examples` directory. ([#268][gh-pull-0268], by
[@peter-scholtens][gh-peter-scholtens])


## Version 0.11.0

### Added
Expand Down Expand Up @@ -673,6 +680,7 @@ The minimum supported Rust version (MSRV) is now 1.51.0 (Mar 25, 2021).
[gh-pull-0275]: https://github.com/moka-rs/moka/pull/275/
[gh-pull-0272]: https://github.com/moka-rs/moka/pull/272/
[gh-pull-0268]: https://github.com/moka-rs/moka/pull/268/
[gh-pull-0265]: https://github.com/moka-rs/moka/pull/265/
[gh-pull-0259]: https://github.com/moka-rs/moka/pull/259/
[gh-pull-0251]: https://github.com/moka-rs/moka/pull/251/
[gh-pull-0248]: https://github.com/moka-rs/moka/pull/248/
Expand Down
4 changes: 3 additions & 1 deletion src/cht/map/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ impl<'g, K: 'g, V: 'g> BucketArray<K, V> {
fn probe(&self, guard: &'g Guard, hash: u64) -> Probe<'_, 'g, K, V> {
let buckets = &self.buckets;
let offset = hash as usize & (buckets.len() - 1);
// FIXME: this will panic if `len() == 0`
// SAFETY: `len()` is never be 0 so this index access will never panic.
// This invariant is ensured by the `assert!()` at the beginning of
// `with_length()` because 0 is not a power of two.
let this_bucket = (offset, &buckets[offset]);
Probe {
buckets,
Expand Down