diff options
| author | Tatsuyuki Ishi <ishitatsuyuki@gmail.com> | 2023-02-25 17:03:03 +0900 |
|---|---|---|
| committer | Tatsuyuki Ishi <ishitatsuyuki@gmail.com> | 2023-02-25 17:05:09 +0900 |
| commit | 116bb4dfb21085ec8e6c45551cc69ff59a3598cd (patch) | |
| tree | f7aae0930d57f7c168cda0d4e8ce7a6d4e13b5a4 /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | 11c589c04661bff6f4cd7df734d1ac7b97bbd9e0 (diff) | |
| download | rust-116bb4dfb21085ec8e6c45551cc69ff59a3598cd.tar.gz rust-116bb4dfb21085ec8e6c45551cc69ff59a3598cd.zip | |
binary_heap: Unify Extend implementation.
Previously the bulk rebuild specialization was only available with Vec, and for general iterators Extend only provided pre-allocation through reserve(). By using a drop guard, we can safely bulk rebuild even if the iterator may panic. This allows benefiting from the bulk rebuild optimization without collecting iterator elements into a Vec beforehand, which would nullify any performance gains from bulk rebuild.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
0 files changed, 0 insertions, 0 deletions
