Fix duration.cpp lint error (#930)
* Fix duration.cpp lint error Signed-off-by: Devin Bonnie <dbbonnie@amazon.com> * Apply review format suggestion Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
This commit is contained in:
parent
59e7bbbe7c
commit
3eb1fe52d7
1 changed files with 2 additions and 2 deletions
|
@ -182,8 +182,8 @@ bounds_check_duration_scale(int64_t dns, double scale, uint64_t max)
|
|||
{
|
||||
auto abs_dns = static_cast<uint64_t>(std::abs(dns));
|
||||
auto abs_scale = std::abs(scale);
|
||||
if (abs_scale > 1.0 &&
|
||||
abs_dns > static_cast<uint64_t>(static_cast<long double>(max) / static_cast<long double>(abs_scale)))
|
||||
if (abs_scale > 1.0 && abs_dns >
|
||||
static_cast<uint64_t>(static_cast<long double>(max) / static_cast<long double>(abs_scale)))
|
||||
{
|
||||
if ((dns > 0 && scale > 0) || (dns < 0 && scale < 0)) {
|
||||
throw std::overflow_error("duration scaling leads to int64_t overflow");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue