Skip to content

Comments

Mark initialization of OnceBox::get_or_try_init cold.#284

Merged
matklad merged 1 commit intomatklad:masterfrom
briansmith:b/dry-get
Mar 28, 2025
Merged

Mark initialization of OnceBox::get_or_try_init cold.#284
matklad merged 1 commit intomatklad:masterfrom
briansmith:b/dry-get

Conversation

@briansmith
Copy link
Contributor

Use Self::get() instead of directly loading the value, which is a DRY improvement in its own right.

Then it is trivial to split out the initialization into a #[cold] function, matching OnceNonZeroUsize.

Use `Self::get()` instead of directly loading the value, which is a
DRY improvement in its own right.

Then it is trivial to split out the initialization into a `#[cold]`
function, matching `OnceNonZeroUsize`.
@matklad matklad merged commit 899e319 into matklad:master Mar 28, 2025
1 check passed
@briansmith briansmith deleted the b/dry-get branch March 31, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants