From a3398a1f078e598da0aa47d268dac35da3917b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wei=C3=9F?= Date: Thu, 6 May 2021 14:07:19 +0200 Subject: [PATCH] Improve SecondsFormatter readability. --- Formatters/SecondsFormatter.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Formatters/SecondsFormatter.m b/Formatters/SecondsFormatter.m index 4b7bcf1c6..96d633924 100644 --- a/Formatters/SecondsFormatter.m +++ b/Formatters/SecondsFormatter.m @@ -29,14 +29,14 @@ return nil; } - double floatValue = [object doubleValue]; + NSTimeInterval timeInterval = [object doubleValue]; - if (isnan(floatValue)) { return @"NaN"; } - if (isinf(floatValue)) { return @"Inf"; } + if (isnan(timeInterval)) { return @"NaN"; } + if (isinf(timeInterval)) { return @"Inf"; } - BOOL isNegative = signbit(floatValue); + BOOL isNegative = signbit(timeInterval); - int totalSeconds = (int)(isNegative ? -floatValue : floatValue); + int totalSeconds = (int)(isNegative ? -timeInterval : timeInterval); int seconds = totalSeconds % 60; int minutes = totalSeconds / 60;