Skip to content

Replace iterative capacity growth with next_power_of_two#1216

Open
SaiCharanMarrivada wants to merge 3 commits intocrossbeam-rs:masterfrom
SaiCharanMarrivada:master
Open

Replace iterative capacity growth with next_power_of_two#1216
SaiCharanMarrivada wants to merge 3 commits intocrossbeam-rs:masterfrom
SaiCharanMarrivada:master

Conversation

@SaiCharanMarrivada
Copy link

Replace the capacity-doubling loop with (reserve_cap + len).next_power_of_two(). Given the existing invariant that capacity is a power of two, the result is identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants