1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 00:04:06 +00:00

refactor: do not reimplement tr_getRatio() in transmission-remote (#4257)

This commit is contained in:
Charles Kerr 2022-11-27 16:58:58 -06:00 committed by GitHub
parent 49393daf01
commit d8327949ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,22 +175,7 @@ static std::string strlratio2(double ratio)
static std::string strlratio(int64_t numerator, int64_t denominator)
{
double ratio;
if (denominator != 0)
{
ratio = numerator / (double)denominator;
}
else if (numerator != 0)
{
ratio = TR_RATIO_INF;
}
else
{
ratio = TR_RATIO_NA;
}
return strlratio2(ratio);
return strlratio2(tr_getRatio(numerator, denominator));
}
static std::string strlmem(int64_t bytes)