-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break out overflow-calculations into semantically-named inlines
Adding days to seconds or millis, or seconds to millis, involves scaling one and adding the other, so has to check for overflow. The std::integral_constant boilerplate and the complications of calling mul_overflow() and add_overflow() rather hid what was going on, so package them in inlines so that their calls are more intelligible. Change-Id: I1e90de8fcb81eb84920868c7e4bd217ee353fc54 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
- Loading branch information
1 parent
acb2faf
commit b9baa42
Showing
2 changed files
with
35 additions
and
22 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