Commit 116bb4d
committed
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.1 parent 11c589c commit 116bb4d
1 file changed
+2
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
| |||
1715 | 1713 | | |
1716 | 1714 | | |
1717 | 1715 | | |
1718 | | - | |
| 1716 | + | |
| 1717 | + | |
1719 | 1718 | | |
1720 | 1719 | | |
1721 | 1720 | | |
| |||
1729 | 1728 | | |
1730 | 1729 | | |
1731 | 1730 | | |
1732 | | - | |
1733 | | - | |
1734 | | - | |
1735 | | - | |
1736 | | - | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
1763 | 1731 | | |
1764 | 1732 | | |
1765 | 1733 | | |
| |||
0 commit comments