Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@myazinn
Copy link
Contributor

@myazinn myazinn commented Jun 21, 2020

There are some issues with the current implementation of * method in zio.duration.Duration.

  • Duration.Infinity * 0 results in Duration.Infinity instead of Duration.Finite(0).
  • Duration.fromNanos(Long.MaxValue) results in Duration.Finite(Long.MaxValue) , while Duration.fromNanos(Long.MaxValue) * 1 results in Duration.Infinity.
  • Duration.fromNanos(5500000000000000000L) * 1.5 results in Duration.Infinitiy, instead of Duration.Finite(8250000000000000000).

This PR fixes these issues.

@CLAassistant
Copy link

CLAassistant commented Jun 21, 2020

CLA assistant check
All committers have signed the CLA.

@myazinn myazinn force-pushed the fix-duration-multiplication branch from 6215654 to fe30010 Compare June 21, 2020 14:33
Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for the fix!

@adamgfraser adamgfraser merged commit 583b675 into zio:master Jun 21, 2020
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