-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Avoid calling user code in no-op round operations
If the given rounding options specify a smallest unit of nanoseconds and a rounding increment of 1, then the rounding operation is a no-op. In that case, return a copy of the duration, without actually performing the rounding operation. This applies to all round(), until(), and since() methods. In the case of Duration.p.round(), other conditions must be fulfilled as well for the operation to be a no-op: no balancing must take place. In the case of Instant.p.round(), PlainDate.p.since(), PlainDate.p.until(), PlainDateTime.p.round(), PlainDateTime.p.since(), PlainDateTime.p.until(), PlainTime.p.round(), PlainTime.p.since(), and PlainTime.p.until(), the change is not observable, so implementors are free to make this optimization anyway. This optimization was already the case in PlainDate.p.since/until() and PlainYearMonth.p.since/until(), so this makes the other since/until() methods consistent with those.
- Loading branch information
Showing
9 changed files
with
145 additions
and
81 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
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
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
Oops, something went wrong.