]> git.lizzy.rs Git - rust.git/commit
Inline hash_table::calculate_offsets, used by iterators.
authorEduard Burtescu <edy.burt@gmail.com>
Sun, 31 May 2015 08:03:46 +0000 (11:03 +0300)
committerEduard Burtescu <edy.burt@gmail.com>
Sun, 31 May 2015 08:03:46 +0000 (11:03 +0300)
commit4a4315bf4bbd8559020689ff6e99d44004c8adb8
treeb7b2cde3b45203f1faf3e17530ff03a1965c2187
parent78c4d53871b3d75b4de5f96cb1f9cdc11648ccc6
Inline hash_table::calculate_offsets, used by iterators.

The `HashMap` and `HashSet` iterators use `RawTable::first_bucket_raw` which is generic and will get inlined cross-crate.
However, `first_bucket_raw` calls `calculate_offsets` and the call doesn't get inlined, despite being a simple function.
This missing `#[inline]` results in `hash_table::calculate_offsets` showing up at the top of a callgrind profile with 3 million calls (for the testcase in #25916).
src/libstd/collections/hash/table.rs