-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #146 - Amanieu:clone_from, r=Amanieu
Optimize Clone implementation Two major changes: - `clone_from` is now implemented which can be used to skip memory allocation if the existing `HashMap` already has enough capacity. - [nightly] Specialization is used to optimize cloning when `T: Copy` into a simple memory copy. - [nightly] Specialization is used to reuse the existing capacity of a `HashMap` when `clone_from` is used. Specialization is needed because the `Clone` impl on `HashMap` is missing `K: Hash + Eq, S: BuildHasher`. Fixes #112
- Loading branch information
Showing
5 changed files
with
281 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
test, | ||
core_intrinsics, | ||
dropck_eyepatch, | ||
specialization, | ||
) | ||
)] | ||
#![allow( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters