From cf365fe40d3079870474b4f98de10b8f40c583da Mon Sep 17 00:00:00 2001 From: Fei Long Wang Date: Wed, 18 Mar 2015 16:02:47 +1300 Subject: [PATCH] Minor improvement Return the variable instead of doing useless check Change-Id: I4c5893157f396c3f4bf6ef9d18ff1692af2c5b33 --- oslo_messaging/_drivers/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_messaging/_drivers/common.py b/oslo_messaging/_drivers/common.py index b2d97b37c..89ad0660e 100644 --- a/oslo_messaging/_drivers/common.py +++ b/oslo_messaging/_drivers/common.py @@ -345,7 +345,7 @@ class DecayingTimer(object): maximum = kwargs.pop('maximum', None) if self._duration is None: - return None if maximum is None else maximum + return maximum if self._ends_at is None: raise RuntimeError(_("Can not check/return a timeout from a timer" " that has not been started."))