Commit d808d28
authored
Rollup merge of rust-lang#147623 - Zalathar:clear-mixed, r=nnethercote
Clear `ChunkedBitSet` without reallocating
There doesn't appear to be any reason to clear a ChunkedBitSet via its constructor (which allocates a new list of chunks), when we could just fill the existing allocation with `Chunk::Zeros` instead.
For comparison, the `insert_all` impl added by the same PR (rust-lang#93984) does the simple thing here and just overwrites every chunk with `Chunk::Ones`.
(That fill was then made somewhat easier by rust-lang#145480, which removes the chunk size from all-zero/all-one chunks.)
r? nnethercote (or compiler)1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
589 | | - | |
| 588 | + | |
590 | 589 | | |
591 | 590 | | |
592 | 591 | | |
| |||
684 | 683 | | |
685 | 684 | | |
686 | 685 | | |
687 | | - | |
688 | | - | |
689 | | - | |
| 686 | + | |
690 | 687 | | |
691 | 688 | | |
692 | 689 | | |
| |||
0 commit comments