Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base_convert: Internalize this trick so the user won't have to worry about it. #67

Open
github-actions bot opened this issue May 28, 2022 · 0 comments
Assignees
Labels
optimize Potential optimization opportunity tracker Issue tracked by bot

Comments

@github-actions
Copy link

github-actions bot commented May 28, 2022

On 2023-08-13 @prestwich wrote in 55c5411 “Merge pull request #293 from recmo/remco/base-to”:

Internalize this trick so the user won't have to worry about it.
Panics

Panics if the base is less than 2.

    /// little-endian order.
    ///
    /// Pro tip: instead of setting `base = 10`, set it to the highest
    /// power of `10` that still fits `u64`. This way much fewer iterations
    /// are required to extract all the digits.
    // OPT: Internalize this trick so the user won't have to worry about it.
    /// # Panics
    ///
    /// Panics if the base is less than 2.
    #[inline]
    pub fn to_base_le(&self, base: u64) -> impl Iterator<Item = u64> {
        assert!(base > 1);
        SpigotLittle {
            base,

From src/base_convert.rs:46

@github-actions github-actions bot added optimize Potential optimization opportunity tracker Issue tracked by bot labels May 28, 2022
@github-actions github-actions bot changed the title base_convert:Find an allocation free method. Maybe extract from the top? base_convert: Find an allocation free method. Maybe extract from the top? May 28, 2022
@github-actions github-actions bot assigned prestwich and unassigned recmo Aug 13, 2023
@github-actions github-actions bot changed the title base_convert: Find an allocation free method. Maybe extract from the top? base_convert: Internalize this trick so the user won't have to worry about it. Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimize Potential optimization opportunity tracker Issue tracked by bot
Projects
None yet
Development

No branches or pull requests

2 participants