Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: avoid casting std::trunc(... / ...) to size_t #44467

Merged

Commits on Aug 31, 2022

  1. src: avoid casting std::trunc(... / ...) to size_t

    Given that the divisor is not zero, the result of dividing unsigned
    integers is an unsigned integer that is always rounded down, i.e.,
    there is no need to call std::trunc(). Doing so unnecessarily yields
    a floating-point number, requiring the result to be cast to an unsigned
    integer again.
    tniessen committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    484d05d View commit details
    Browse the repository at this point in the history