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

Remove checking of a constant value #37

Merged
merged 1 commit into from
Mar 29, 2017
Merged

Remove checking of a constant value #37

merged 1 commit into from
Mar 29, 2017

Conversation

BlueMonday
Copy link
Contributor

The NewExponentialBackOff function initalizes an instance of the
ExponentialBackOff struct with the DefaultRandomizationFactor constant
as the RandomizationFactor field. It then checks if the RandomizationFactor
field of the struct is less than 0 or greater than 1.

The checks were currently not doing much since the value they were
checking is a constant and will always be between 0 and 1. The
validation would make sense if the value was provided by the caller of
the function (in this case it isn't).

The NewExponentialBackOff function initalizes an instance of the
ExponentialBackOff struct with the DefaultRandomizationFactor constant
as the RandomizationFactor field. It then checks if the RandomizationFactor
field of the struct is less than 0 or greater than 1.

The checks were currently not doing much since the value they were
checking is a constant and will always be between 0 and 1. The
validation would make sense if the value was provided by the caller of
the function (in this case it isn't).

Signed-off-by: Steven Erenst <stevenerenst@gmail.com>
@coveralls
Copy link

coveralls commented Mar 29, 2017

Coverage Status

Coverage increased (+1.4%) to 82.317% when pulling 1892454 on BlueMonday:master into 3db60c8 on cenkalti:master.

@cenkalti cenkalti merged commit 5d150e7 into cenkalti:master Mar 29, 2017
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.

3 participants