From 7317c7be736f3e468b87bd634085877d9b3d89a5 Mon Sep 17 00:00:00 2001 From: Berger Eugene Date: Sat, 21 Dec 2024 00:06:27 +0200 Subject: [PATCH] fix: Remove unnecessary conversion --- src/app/pc_string.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pc_string.go b/src/app/pc_string.go index 03a8340..da6e97c 100644 --- a/src/app/pc_string.go +++ b/src/app/pc_string.go @@ -51,11 +51,11 @@ func HumanDuration(d time.Duration) string { } else if hours < 24*365*2 { return fmt.Sprintf("%dd", hours/24) } else if hours < 24*365*8 { - dy := int(hours/24) % 365 + dy := hours / 24 % 365 if dy == 0 { return fmt.Sprintf("%dy", hours/24/365) } return fmt.Sprintf("%dy%dd", hours/24/365, dy) } - return fmt.Sprintf("%dy", int(hours/24/365)) + return fmt.Sprintf("%dy", hours/24/365) }