Skip to content

factor::miller_rabin: Minor improvements#1562

Merged
rivy merged 3 commits into
uutils:masterfrom
nicoonoclaste:factor/faster/miller-rabbin
Jul 25, 2020
Merged

factor::miller_rabin: Minor improvements#1562
rivy merged 3 commits into
uutils:masterfrom
nicoonoclaste:factor/faster/miller-rabbin

Conversation

@nicoonoclaste
Copy link
Copy Markdown
Contributor

  • Remove duplicate computation.
  • Mark miller_rabbin::Result as #[must_use] to ensure no useless
    computation is performed.

Will conflict with #1554, but the merge should be pretty trivial.

The duplicate work was introduced in 2015.
Ignoring a value of that type is a bug: they are only produced by
`miller_rabbin::test`, which is a pure, but expensive, function.

As such, an ignored value is always either a mistake, or an easy
optimisation opportunity (just remove the useless call to `test`).
@nicoonoclaste
Copy link
Copy Markdown
Contributor Author

Rebased post #1554

@rivy rivy merged commit c04c7a1 into uutils:master Jul 25, 2020
@nicoonoclaste nicoonoclaste deleted the factor/faster/miller-rabbin branch July 25, 2020 13:01
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