From d8327949accb889f95d15013babcd54093f074b1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 27 Nov 2022 16:58:58 -0600 Subject: [PATCH] refactor: do not reimplement tr_getRatio() in transmission-remote (#4257) --- utils/remote.cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/utils/remote.cc b/utils/remote.cc index 4f144930b..848917c83 100644 --- a/utils/remote.cc +++ b/utils/remote.cc @@ -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)