-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Do away with CalculateOffsetShift in Duration.compare
CalculateOffsetShift is only used in Duration.compare, when relativeTo is a ZonedDateTime. Calling it twice performs two ZonedDateTime additions, which are potentially user-observable method calls. If we are performing these two additions anyway, we may as well just add each duration to relativeTo and compare the timestamps. This saves a lot of other user-observable calls. It also allows removing the offset-shift parameter from TotalDurationNanoseconds, because now it is always zero. That parameter was confusing anyway.
- Loading branch information
Showing
3 changed files
with
79 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters