Skip to content

Check if lazy ONE and TWO are needed #20

@jlapeyre

Description

@jlapeyre

I wonder why these are needed:

static TWO: Lazy<IBig> = Lazy::new(|| IBig::from(2));
static ONE: Lazy<IBig> = Lazy::new(|| IBig::ONE);
if n <= *ONE {

Is it because IBig::ONE looks like a constant, but is actually recomputed when accessed?

If so, there are many more of these in static data, for example in rings.rs that may also benefit
from caching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions