From cb77d168129ff924c0ebaf56fb2eb004681d5fb3 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 29 Nov 2008 05:48:11 +0000 Subject: [PATCH] Minor optimization in ftime --- deluge/common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deluge/common.py b/deluge/common.py index 2a8d0c3c0..8555f0c67 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -298,20 +298,20 @@ def ftime(seconds): if seconds < 60: return '%ds' % (seconds) minutes = seconds / 60 - seconds = seconds % 60 if minutes < 60: + seconds = seconds % 60 return '%dm %ds' % (minutes, seconds) hours = minutes / 60 - minutes = minutes % 60 if hours < 24: + minutes = minutes % 60 return '%dh %dm' % (hours, minutes) days = hours / 24 - hours = hours % 24 if days < 7: + hours = hours % 24 return '%dd %dh' % (days, hours) weeks = days / 7 - days = days % 7 if weeks < 52: + days = days % 7 return '%dw %dd' % (weeks, days) years = weeks / 52 weeks = weeks % 52